summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6.c2
-rw-r--r--sys/netinet6/scope6.c9
-rw-r--r--sys/netinet6/scope6_var.h5
3 files changed, 16 insertions, 0 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 63b64ee..8da46cf 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -2669,6 +2669,8 @@ in6_lltable_dump(struct lltable *llt, struct sysctl_req *wr)
ndpc.sin6.sin6_family = AF_INET6;
ndpc.sin6.sin6_len = sizeof(ndpc.sin6);
bcopy(L3_ADDR(lle), &ndpc.sin6, L3_ADDR_LEN(lle));
+ if (V_deembed_scopeid)
+ sa6_recoverscope(&ndpc.sin6);
/* publish */
if (lle->la_flags & LLE_PUB)
diff --git a/sys/netinet6/scope6.c b/sys/netinet6/scope6.c
index edfb1e6..060fe59 100644
--- a/sys/netinet6/scope6.c
+++ b/sys/netinet6/scope6.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#include <sys/systm.h>
#include <sys/queue.h>
+#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <net/if.h>
@@ -55,6 +56,11 @@ 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_VNET_INT(_net_inet6_ip6, OID_AUTO, deembed_scopeid, 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
@@ -379,8 +385,11 @@ sa6_recoverscope(struct sockaddr_in6 *sin6)
/* sanity check */
if (V_if_index < zoneid)
return (ENXIO);
+#if 0
+ /* XXX: Disabled due to possible deadlock. */
if (!ifnet_byindex(zoneid))
return (ENXIO);
+#endif
if (sin6->sin6_scope_id != 0 &&
zoneid != sin6->sin6_scope_id) {
log(LOG_NOTICE,
diff --git a/sys/netinet6/scope6_var.h b/sys/netinet6/scope6_var.h
index ae337b8..87de8d7 100644
--- a/sys/netinet6/scope6_var.h
+++ b/sys/netinet6/scope6_var.h
@@ -34,6 +34,8 @@
#define _NETINET6_SCOPE6_VAR_H_
#ifdef _KERNEL
+#include <net/vnet.h>
+
struct scope6_id {
/*
* 16 is correspondent to 4bit multicast scope field.
@@ -42,6 +44,9 @@ struct scope6_id {
u_int32_t s6id_list[16];
};
+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 *);
OpenPOWER on IntegriCloud