aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRyan Stone <rstone@FreeBSD.org>2018-02-21 19:13:23 +0000
committerRyan Stone <rstone@FreeBSD.org>2018-02-21 19:13:23 +0000
commitb3b6ff23e70ef5c1551941463a561447654402cb (patch)
tree3684e9a3fe51aba028fdfc1b1f4279358f0e38f9 /sys
parent81ad57b1b86a564140a59992e4d7a04a9090df32 (diff)
downloadsrc-b3b6ff23e70ef5c1551941463a561447654402cb.tar.gz
src-b3b6ff23e70ef5c1551941463a561447654402cb.zip
Allow route change requests to not specify the gateway.
Only require a gateway to be specified on a route add request. On a route change request that does not specify the gateway, the gateway will remain the same. This allows changing other route parameters without having to re-specifying the gateway, like in "route change 10.0.0.0/8 -mtu 9000". Update the route(8) manpage to explicitly call out this usage as being supported. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Reviewed By: eugen (rtsock.c change), rgrimes Differential Revision: https://reviews.freebsd.org/D14291
Notes
Notes: svn path=/head/; revision=329743
Diffstat (limited to 'sys')
-rw-r--r--sys/net/rtsock.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 26b888f21532..e21af57b40de 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -674,12 +674,15 @@ route_output(struct mbuf *m, struct socket *so, ...)
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