Author: melifaro
Date: Sat Aug 15 11:37:44 2020
New Revision: 364250
URL: https://svnweb.freebsd.org/changeset/base/364250

Log:
  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

Modified:
  head/sys/net/rtsock.c
  head/sys/netinet6/in6.c
  head/sys/netinet6/scope6.c
  head/sys/netinet6/scope6_var.h

Modified: head/sys/net/rtsock.c
==============================================================================
--- head/sys/net/rtsock.c       Sat Aug 15 11:28:01 2020        (r364249)
+++ head/sys/net/rtsock.c       Sat Aug 15 11:37:44 2020        (r364250)
@@ -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
                        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)

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c     Sat Aug 15 11:28:01 2020        (r364249)
+++ head/sys/netinet6/in6.c     Sat Aug 15 11:37:44 2020        (r364250)
@@ -2374,8 +2374,7 @@ in6_lltable_dump_entry(struct lltable *llt, struct 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)

Modified: head/sys/netinet6/scope6.c
==============================================================================
--- head/sys/netinet6/scope6.c  Sat Aug 15 11:28:01 2020        (r364249)
+++ head/sys/netinet6/scope6.c  Sat Aug 15 11:37:44 2020        (r364250)
@@ -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

Modified: head/sys/netinet6/scope6_var.h
==============================================================================
--- head/sys/netinet6/scope6_var.h      Sat Aug 15 11:28:01 2020        
(r364249)
+++ head/sys/netinet6/scope6_var.h      Sat Aug 15 11:37:44 2020        
(r364250)
@@ -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 *);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to