Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F135955186
D14291.id39386.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14291.id39386.diff
View Options
Index: sbin/route/route.8
===================================================================
--- sbin/route/route.8
+++ sbin/route/route.8
@@ -28,7 +28,7 @@
.\" @(#)route.8 8.3 (Berkeley) 3/19/94
.\" $FreeBSD$
.\"
-.Dd November 11, 2014
+.Dd February 16, 2018
.Dt ROUTE 8
.Os
.Sh NAME
@@ -171,8 +171,8 @@
.Op Fl n
.Ar command
.Op Fl net No \&| Fl host
-.Ar destination gateway
-.Op Ar netmask
+.Ar destination
+.Op Ar gateway Op Ar netmask
.Op Fl fib Ar number
.Ed
.Pp
@@ -181,6 +181,9 @@
is the destination host or network,
.Ar gateway
is the next-hop intermediary via which packets should be routed.
+The
+.Ar gateway
+argument is mandatory for the add command.
Routes to a particular host may be distinguished from those to
a network by interpreting the Internet address specified as the
.Ar destination
Index: sys/net/rtsock.c
===================================================================
--- sys/net/rtsock.c
+++ sys/net/rtsock.c
@@ -674,12 +674,15 @@
case RTM_ADD:
case RTM_CHANGE:
- if (info.rti_info[RTAX_GATEWAY] == NULL)
- senderr(EINVAL);
+ if (rtm->rtm_type == RTM_ADD) {
+ if (info.rti_info[RTAX_GATEWAY] == NULL)
+ senderr(EINVAL);
+ }
saved_nrt = NULL;
/* support for new ARP code */
- if (info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK &&
+ if (info.rti_info[RTAX_GATEWAY] != NULL &&
+ info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK &&
(rtm->rtm_flags & RTF_LLDATA) != 0) {
error = lla_rt_output(rtm, &info);
#ifdef INET6
@@ -688,6 +691,7 @@
#endif
break;
}
+
error = rtrequest1_fib(rtm->rtm_type, &info, &saved_nrt,
fibnum);
if (error == 0 && saved_nrt != NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 15, 1:08 PM (4 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25327286
Default Alt Text
D14291.id39386.diff (1 KB)
Attached To
Mode
D14291: Allow route change requests to not specify the gateway.
Attached
Detach File
Event Timeline
Log In to Comment