Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/nd6_rtr.c
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
#include <sys/syslog.h> | #include <sys/syslog.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <net/if.h> | #include <net/if.h> | ||||
#include <net/if_var.h> | #include <net/if_var.h> | ||||
#include <net/if_types.h> | #include <net/if_types.h> | ||||
#include <net/if_dl.h> | #include <net/if_dl.h> | ||||
#include <net/route.h> | #include <net/route.h> | ||||
#include <net/route/nhop.h> | |||||
#include <net/route_var.h> | #include <net/route_var.h> | ||||
#include <net/radix.h> | #include <net/radix.h> | ||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <net/if_llatbl.h> | #include <net/if_llatbl.h> | ||||
#include <netinet6/in6_var.h> | #include <netinet6/in6_var.h> | ||||
#include <netinet6/in6_ifattach.h> | #include <netinet6/in6_ifattach.h> | ||||
▲ Show 20 Lines • Show All 2,317 Lines • ▼ Show 20 Lines | in6_tmpifadd(const struct in6_ifaddr *ia0, int forcegen, int delay) | ||||
* temporary address due to deprecation of an old temporary address. | * temporary address due to deprecation of an old temporary address. | ||||
*/ | */ | ||||
pfxlist_onlink_check(); | pfxlist_onlink_check(); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | 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; | 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); | 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); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Do not delete a static route. | * Do not delete a static route. | ||||
* XXX: this seems to be a bit ad-hoc. Should we consider the | * XXX: this seems to be a bit ad-hoc. Should we consider the | ||||
* 'cloned' bit instead? | * '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); | return (0); | ||||
/* | /* | ||||
* We delete only host route. This means, in particular, we don't | * We delete only host route. This means, in particular, we don't | ||||
* delete default route. | * delete default route. | ||||
*/ | */ | ||||
if ((rt->rt_flags & RTF_HOST) == 0) | if ((nh_rt_flags & RTF_HOST) == 0) | ||||
return (0); | return (0); | ||||
return (1); | return (1); | ||||
#undef SIN6 | #undef SIN6 | ||||
} | } | ||||
/* | /* | ||||
* Delete all the routing table entries that use the specified gateway. | * Delete all the routing table entries that use the specified gateway. | ||||
▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines |