Page MenuHomeFreeBSD

D14291.id39396.diff
No OneTemporary

D14291.id39396.diff

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
@@ -164,18 +164,30 @@
the specified FIB
.Pq routing table .
.Pp
-The other commands have the following syntax:
+The add command has the following syntax:
.Pp
.Bd -ragged -offset indent -compact
.Nm
.Op Fl n
-.Ar command
+.Cm add
.Op Fl net No \&| Fl host
.Ar destination gateway
.Op Ar netmask
.Op Fl fib Ar number
.Ed
.Pp
+and the other commands have the following syntax:
+.Pp
+.Bd -ragged -offset indent -compact
+.Nm
+.Op Fl n
+.Ar command
+.Op Fl net No \&| Fl host
+.Ar destination
+.Op Ar gateway Op Ar netmask
+.Op Fl fib Ar number
+.Ed
+.Pp
where
.Ar destination
is the destination host or network,
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

Mime Type
text/plain
Expires
Fri, Jul 10, 9:24 PM (18 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34940907
Default Alt Text
D14291.id39396.diff (1 KB)

Event Timeline