diff options
author | Sridhar Samudrala <sri@us.ibm.com> | 2006-07-21 17:49:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 17:49:25 -0400 |
commit | dc022a9874d026c7d1635ae66d1afafc5f053731 (patch) | |
tree | 3a1feddee57eabd788311e2433e922b59036e903 /net/sctp/bind_addr.c | |
parent | 9faa730f1cbb951e95cb18e71b0fe265014c2450 (diff) |
[SCTP]: ADDIP: Don't use an address as source until it is ASCONF-ACKed
This implements Rules D1 and D4 of Sec 4.3 in the ADDIP draft.
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/bind_addr.c')
-rw-r--r-- | net/sctp/bind_addr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index 2b962627f631..2b9c12a170e5 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c | |||
@@ -146,7 +146,7 @@ void sctp_bind_addr_free(struct sctp_bind_addr *bp) | |||
146 | 146 | ||
147 | /* Add an address to the bind address list in the SCTP_bind_addr structure. */ | 147 | /* Add an address to the bind address list in the SCTP_bind_addr structure. */ |
148 | int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new, | 148 | int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new, |
149 | gfp_t gfp) | 149 | __u8 use_as_src, gfp_t gfp) |
150 | { | 150 | { |
151 | struct sctp_sockaddr_entry *addr; | 151 | struct sctp_sockaddr_entry *addr; |
152 | 152 | ||
@@ -163,6 +163,8 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new, | |||
163 | if (!addr->a.v4.sin_port) | 163 | if (!addr->a.v4.sin_port) |
164 | addr->a.v4.sin_port = bp->port; | 164 | addr->a.v4.sin_port = bp->port; |
165 | 165 | ||
166 | addr->use_as_src = use_as_src; | ||
167 | |||
166 | INIT_LIST_HEAD(&addr->list); | 168 | INIT_LIST_HEAD(&addr->list); |
167 | list_add_tail(&addr->list, &bp->address_list); | 169 | list_add_tail(&addr->list, &bp->address_list); |
168 | SCTP_DBG_OBJCNT_INC(addr); | 170 | SCTP_DBG_OBJCNT_INC(addr); |
@@ -274,7 +276,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list, | |||
274 | } | 276 | } |
275 | 277 | ||
276 | af->from_addr_param(&addr, rawaddr, port, 0); | 278 | af->from_addr_param(&addr, rawaddr, port, 0); |
277 | retval = sctp_add_bind_addr(bp, &addr, gfp); | 279 | retval = sctp_add_bind_addr(bp, &addr, 1, gfp); |
278 | if (retval) { | 280 | if (retval) { |
279 | /* Can't finish building the list, clean up. */ | 281 | /* Can't finish building the list, clean up. */ |
280 | sctp_bind_addr_clean(bp); | 282 | sctp_bind_addr_clean(bp); |
@@ -367,7 +369,7 @@ static int sctp_copy_one_addr(struct sctp_bind_addr *dest, | |||
367 | (((AF_INET6 == addr->sa.sa_family) && | 369 | (((AF_INET6 == addr->sa.sa_family) && |
368 | (flags & SCTP_ADDR6_ALLOWED) && | 370 | (flags & SCTP_ADDR6_ALLOWED) && |
369 | (flags & SCTP_ADDR6_PEERSUPP)))) | 371 | (flags & SCTP_ADDR6_PEERSUPP)))) |
370 | error = sctp_add_bind_addr(dest, addr, gfp); | 372 | error = sctp_add_bind_addr(dest, addr, 1, gfp); |
371 | } | 373 | } |
372 | 374 | ||
373 | return error; | 375 | return error; |