summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2007-06-15 03:16:48 +0000
committerrrs <rrs@FreeBSD.org>2007-06-15 03:16:48 +0000
commitc1835c966dbb707a059f625ba7db55b9f754c9ab (patch)
tree8ed6f0307bb3d2c3f44e89a4e53ef2d270a3a82a /sys/netinet
parentbc108718c3d31b2745c2045d1712663fabe2cc72 (diff)
downloadFreeBSD-src-c1835c966dbb707a059f625ba7db55b9f754c9ab.zip
FreeBSD-src-c1835c966dbb707a059f625ba7db55b9f754c9ab.tar.gz
- Add VRF id to sctp_ifa structure, needed mainly in panda but useful
during deletes of ifa's in diff VRF's when applicable.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/sctp_asconf.c5
-rw-r--r--sys/netinet/sctp_pcb.c2
-rw-r--r--sys/netinet/sctp_pcb.h1
3 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c
index 1b54257..df8c290 100644
--- a/sys/netinet/sctp_asconf.c
+++ b/sys/netinet/sctp_asconf.c
@@ -1704,6 +1704,11 @@ sctp_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr,
LIST_FOREACH(l, &asc->list_of_work, sctp_nxt_addr) {
ifa = l->ifa;
type = l->action;
+
+ /* address's vrf_id must be the vrf_id of the assoc */
+ if (ifa->vrf_id != stcb->asoc.vrf_id) {
+ continue;
+ }
/* Same checks again for assoc */
if (ifa->address.sa.sa_family == AF_INET6) {
/* invalid if we're not a v6 endpoint */
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 0160aea..4d23f24 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -414,7 +414,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index,
memset(sctp_ifap, 0, sizeof(struct sctp_ifa));
sctp_ifap->ifn_p = sctp_ifnp;
atomic_add_int(&sctp_ifnp->refcount, 1);
-
+ sctp_ifap->vrf_id = vrf_id;
sctp_ifap->ifa = ifa;
memcpy(&sctp_ifap->address, addr, addr->sa_len);
sctp_ifap->localifa_flags = SCTP_ADDR_VALID | SCTP_ADDR_DEFER_USE;
diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h
index 638def0..2921459 100644
--- a/sys/netinet/sctp_pcb.h
+++ b/sys/netinet/sctp_pcb.h
@@ -109,6 +109,7 @@ struct sctp_ifa {
uint32_t refcount; /* number of folks refering to this */
uint32_t flags;
uint32_t localifa_flags;
+ uint32_t vrf_id; /* vrf_id of this addr (for deleting) */
uint8_t src_is_loop;
uint8_t src_is_priv;
uint8_t src_is_glob;
OpenPOWER on IntegriCloud