summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2012-12-05 19:45:24 +0000
committerhrs <hrs@FreeBSD.org>2012-12-05 19:45:24 +0000
commit377b89c55f75aba70c2c66bfc96fb4c4af7311ae (patch)
tree54a3401d4d89d95ebe41cab5790300d24c5a6268 /sys/netinet6
parentefc06bd8013ad630fe9083f423265d89b9d717ff (diff)
downloadFreeBSD-src-377b89c55f75aba70c2c66bfc96fb4c4af7311ae.zip
FreeBSD-src-377b89c55f75aba70c2c66bfc96fb4c4af7311ae.tar.gz
- Move definition of V_deembed_scopeid to scope6_var.h.
- Deembed scope id in L3 address in in6_lltable_dump(). - Simplify scope id recovery in rtsock routines. - Remove embedded scope id handling in ndp(8) and route(8) completely.
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