diff options
| author | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2020-04-16 17:20:18 +0000 |
|---|---|---|
| committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2020-04-16 17:20:18 +0000 |
| commit | 539642a29d7c9c88612a13c4346c8f152c4d144e (patch) | |
| tree | 3f63a0a8aeb4425028522abfa4f79ec3cf47317f /sys/netinet6 | |
| parent | f943f61c081cf16a1086d1710bf7b882d8c58922 (diff) | |
Notes
Diffstat (limited to 'sys/netinet6')
| -rw-r--r-- | sys/netinet6/nd6.c | 6 | ||||
| -rw-r--r-- | sys/netinet6/nd6_rtr.c | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 1c61bccdbb0e4..12f61a853af2c 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include <net/if_dl.h> #include <net/if_types.h> #include <net/route.h> +#include <net/route/nhop.h> #include <net/vnet.h> #include <netinet/in.h> @@ -1526,14 +1527,15 @@ nd6_free(struct llentry **lnp, int gc) } static int -nd6_isdynrte(const struct rtentry *rt, void *xap) +nd6_isdynrte(const struct rtentry *rt, const struct nhop_object *nh, void *xap) { - if (rt->rt_flags == (RTF_UP | RTF_HOST | RTF_DYNAMIC)) + if (nh->nh_flags & NHF_REDIRECT) return (1); return (0); } + /* * Remove the rtentry for the given llentry, * both of which were installed by a redirect. diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 2fcf16e75d314..89aa1eedd38a3 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include <net/if_types.h> #include <net/if_dl.h> #include <net/route.h> +#include <net/route/nhop.h> #include <net/route_var.h> #include <net/radix.h> #include <net/vnet.h> @@ -2392,15 +2393,16 @@ in6_tmpifadd(const struct in6_ifaddr *ia0, int forcegen, int delay) } static int -rt6_deleteroute(const struct rtentry *rt, void *arg) +rt6_deleteroute(const struct rtentry *rt, const struct nhop_object *nh, + void *arg) { -#define SIN6(s) ((struct sockaddr_in6 *)s) struct in6_addr *gate = (struct in6_addr *)arg; + int nh_rt_flags; - if (rt->rt_gateway == NULL || rt->rt_gateway->sa_family != AF_INET6) + if (nh->gw_sa.sa_family != AF_INET6) return (0); - if (!IN6_ARE_ADDR_EQUAL(gate, &SIN6(rt->rt_gateway)->sin6_addr)) { + if (!IN6_ARE_ADDR_EQUAL(gate, &nh->gw6_sa.sin6_addr)) { return (0); } @@ -2409,14 +2411,15 @@ rt6_deleteroute(const struct rtentry *rt, void *arg) * XXX: this seems to be a bit ad-hoc. Should we consider the * 'cloned' bit instead? */ - if ((rt->rt_flags & RTF_STATIC) != 0) + nh_rt_flags = nhop_get_rtflags(nh); + if ((nh_rt_flags & RTF_STATIC) != 0) return (0); /* * We delete only host route. This means, in particular, we don't * delete default route. */ - if ((rt->rt_flags & RTF_HOST) == 0) + if ((nh_rt_flags & RTF_HOST) == 0) return (0); return (1); |
