diff options
author | Zhenlei Huang <zlei.huang@gmail.com> | 2021-08-22 22:28:47 +0000 |
---|---|---|
committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2021-08-22 22:56:08 +0000 |
commit | 62e1a437f3285e785d9b35a476d36a469a90028d (patch) | |
tree | 371cf19e2cae5884ebac7bc3a864d2b056aa7f1c /sys/netgraph/ng_iface.c | |
parent | eccb516db8b7fec957b139c3a9a2e16175551067 (diff) | |
download | src-62e1a437f3285e785d9b35a476d36a469a90028d.tar.gz src-62e1a437f3285e785d9b35a476d36a469a90028d.zip |
routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549).
Implement kernel support for RFC 5549/8950.
* Relax control plane restrictions and allow specifying IPv6 gateways
for IPv4 routes. This behavior is controlled by the
net.route.rib_route_ipv6_nexthop sysctl (on by default).
* Always pass final destination in ro->ro_dst in ip_forward().
* Use ro->ro_dst to exract packet family inside if_output() routines.
Consistently use RO_GET_FAMILY() macro to handle ro=NULL case.
* Pass extracted family to nd6_resolve() to get the LLE with proper encap.
It leverages recent lltable changes committed in c541bd368f86.
Presence of the functionality can be checked using ipv4_rfc5549_support feature(3).
Example usage:
route add -net 192.0.0.0/24 -inet6 fe80::5054:ff:fe14:e319%vtnet0
Differential Revision: https://reviews.freebsd.org/D30398
MFC after: 2 weeks
Diffstat (limited to 'sys/netgraph/ng_iface.c')
-rw-r--r-- | sys/netgraph/ng_iface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 1e586d687244..e6871435fa88 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -371,7 +371,7 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m, if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); else - af = dst->sa_family; + af = RO_GET_FAMILY(ro, dst); /* Berkeley packet filter */ ng_iface_bpftap(ifp, m, af); |