diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2020-03-03 09:50:33 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2020-03-03 09:50:33 +0000 |
commit | 5f3e375ed8001ef4d5eecc7c543561e925add6cd (patch) | |
tree | 3bcb01bec7f0a3f03bc8a688fd24697751cf7708 /sys/netinet6 | |
parent | f6428cdb1fbc5cf5d914f9b8d6f0db556e73b8a4 (diff) | |
download | src-5f3e375ed8001ef4d5eecc7c543561e925add6cd.tar.gz src-5f3e375ed8001ef4d5eecc7c543561e925add6cd.zip |
in6_fib: return nh_ia in the ext interface as we do for IPv4
Like for IPv4 add nh_ia to the ext interface and return rt_ifa
in order to be used for, e.g., packet/octets accounting purposes.
Reviewed by: melifaro
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D23873
Notes
Notes:
svn path=/head/; revision=358569
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/in6_fib.c | 3 | ||||
-rw-r--r-- | sys/netinet6/in6_fib.h | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet6/in6_fib.c b/sys/netinet6/in6_fib.c index 0f471394d3ea..ae4beab3b5ce 100644 --- a/sys/netinet6/in6_fib.c +++ b/sys/netinet6/in6_fib.c @@ -75,6 +75,8 @@ static void fib6_rte_to_nh_basic(struct rtentry *rte, const struct in6_addr *dst static struct ifnet *fib6_get_ifaifp(struct rtentry *rte); #define RNTORT(p) ((struct rtentry *)(p)) +#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) + CHK_STRUCT_ROUTE_COMPAT(struct route_in6, ro_dst); /* @@ -153,6 +155,7 @@ fib6_rte_to_nh_extended(struct rtentry *rte, const struct in6_addr *dst, gw = (struct sockaddr_in6 *)rt_key(rte); if (IN6_IS_ADDR_UNSPECIFIED(&gw->sin6_addr)) pnh6->nh_flags |= NHF_DEFAULT; + pnh6->nh_ia = ifatoia6(rte->rt_ifa); } /* diff --git a/sys/netinet6/in6_fib.h b/sys/netinet6/in6_fib.h index 53f35a846035..fa07a5ce9a3e 100644 --- a/sys/netinet6/in6_fib.h +++ b/sys/netinet6/in6_fib.h @@ -41,14 +41,15 @@ struct nhop6_basic { struct in6_addr nh_addr; /* GW/DST IPv4 address */ }; -/* Does not differ from nhop6_basic */ +/* Extended nexthop info used for control protocols. */ struct nhop6_extended { struct ifnet *nh_ifp; /* Logical egress interface */ + struct in6_ifaddr *nh_ia; /* Associated address. */ uint16_t nh_mtu; /* nexthop mtu */ uint16_t nh_flags; /* nhop flags */ uint8_t spare[4]; struct in6_addr nh_addr; /* GW/DST IPv6 address */ - uint64_t spare2[2]; + uint64_t spare2[1]; }; int fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, |