1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-11 09:50:12 +00:00

Make net.inet6.ip6.deembed_scopeid behaviour default & remove sysctl.

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Differential Revision:	https://reviews.freebsd.org/D25637
This commit is contained in:
Alexander V. Chernikov 2020-08-15 11:37:44 +00:00
parent 04996cb74b
commit bec053ffe0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=364250
4 changed files with 6 additions and 14 deletions

View File

@ -900,7 +900,7 @@ route_output(struct mbuf *m, struct socket *so, ...)
error = lla_rt_output(rtm, &info);
#ifdef INET6
if (error == 0)
rti_need_deembed = (V_deembed_scopeid) ? 1 : 0;
rti_need_deembed = 1;
#endif
goto flush;
}
@ -915,7 +915,7 @@ route_output(struct mbuf *m, struct socket *so, ...)
error = rib_action(fibnum, rtm->rtm_type, &info, &rc);
if (error == 0) {
#ifdef INET6
rti_need_deembed = (V_deembed_scopeid) ? 1 : 0;
rti_need_deembed = 1;
#endif
rtm->rtm_index = rc.rc_nh_new->nh_ifp->if_index;
nh = rc.rc_nh_new;
@ -930,7 +930,7 @@ route_output(struct mbuf *m, struct socket *so, ...)
}
#ifdef INET6
/* rt_msg2() will not be used when RTM_DELETE fails. */
rti_need_deembed = (V_deembed_scopeid) ? 1 : 0;
rti_need_deembed = 1;
#endif
break;
@ -1192,7 +1192,7 @@ rtsock_msg_mbuf(int type, struct rt_addrinfo *rtinfo)
rtinfo->rti_addrs |= (1 << i);
dlen = SA_SIZE(sa);
#ifdef INET6
if (V_deembed_scopeid && sa->sa_family == AF_INET6) {
if (sa->sa_family == AF_INET6) {
sin6 = (struct sockaddr_in6 *)&ss;
bcopy(sa, sin6, sizeof(*sin6));
if (sa6_recoverscope(sin6) == 0)
@ -1298,7 +1298,7 @@ rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo, struct walkarg *w, int *
dlen = SA_SIZE(sa);
if (cp != NULL && buflen >= dlen) {
#ifdef INET6
if (V_deembed_scopeid && sa->sa_family == AF_INET6) {
if (sa->sa_family == AF_INET6) {
sin6 = (struct sockaddr_in6 *)&ss;
bcopy(sa, sin6, sizeof(*sin6));
if (sa6_recoverscope(sin6) == 0)

View File

@ -2374,8 +2374,7 @@ in6_lltable_dump_entry(struct lltable *llt, struct llentry *lle,
ndpc.rtm.rtm_type = RTM_GET;
ndpc.rtm.rtm_flags = RTF_UP;
ndpc.rtm.rtm_addrs = RTA_DST | RTA_GATEWAY;
if (V_deembed_scopeid)
sa6_recoverscope(&ndpc.sin6);
sa6_recoverscope(&ndpc.sin6);
/* publish */
if (lle->la_flags & LLE_PUB)

View File

@ -60,11 +60,7 @@ VNET_DEFINE(int, ip6_use_defzone) = 1;
#else
VNET_DEFINE(int, ip6_use_defzone) = 0;
#endif
VNET_DEFINE(int, deembed_scopeid) = 1;
SYSCTL_DECL(_net_inet6_ip6);
SYSCTL_INT(_net_inet6_ip6, OID_AUTO, deembed_scopeid, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(deembed_scopeid), 0,
"Extract embedded zone ID and set it to sin6_scope_id in sockaddr_in6.");
/*
* The scope6_lock protects the global sid default stored in

View File

@ -47,9 +47,6 @@ struct scope6_id {
uint32_t s6id_list[IPV6_ADDR_SCOPES_COUNT];
};
VNET_DECLARE(int, deembed_scopeid);
#define V_deembed_scopeid VNET(deembed_scopeid)
void scope6_init(void);
struct scope6_id *scope6_ifattach(struct ifnet *);
void scope6_ifdetach(struct scope6_id *);