]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549).
authorZhenlei Huang <zlei.huang@gmail.com>
Sun, 22 Aug 2021 22:28:47 +0000 (22:28 +0000)
committerAlexander V. Chernikov <melifaro@FreeBSD.org>
Sun, 22 Aug 2021 22:56:08 +0000 (22:56 +0000)
commit62e1a437f3285e785d9b35a476d36a469a90028d
tree371cf19e2cae5884ebac7bc3a864d2b056aa7f1c
parenteccb516db8b7fec957b139c3a9a2e16175551067
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
23 files changed:
sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
sys/dev/cxgbe/tom/t4_listen.c
sys/dev/iicbus/if_ic.c
sys/net/debugnet.c
sys/net/if_disc.c
sys/net/if_ethersubr.c
sys/net/if_fwsubr.c
sys/net/if_gif.c
sys/net/if_gre.c
sys/net/if_infiniband.c
sys/net/if_loop.c
sys/net/if_me.c
sys/net/if_spppsubr.c
sys/net/if_tuntap.c
sys/net/route.h
sys/net/route/route_ctl.c
sys/netgraph/netflow/netflow.c
sys/netgraph/ng_iface.c
sys/netinet/ip_fastfwd.c
sys/netinet/ip_input.c
sys/netinet/ip_output.c
sys/netinet/toecore.c
sys/ofed/drivers/infiniband/core/ib_addr.c