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
This commit is contained in:
bz 2020-03-03 09:50:33 +00:00
parent 9ff4287dfe
commit 43eb74c7db
2 changed files with 6 additions and 2 deletions

View File

@ -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);
}
/*

View File

@ -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,