diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-12-06 22:50:54 -0800 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-12-07 01:07:49 -0800 |
commit | 8e71a11c9f3c09a01fcb445772ffd61b140f2479 (patch) | |
tree | a0fb2c002d472252ea060c88f8dfda6ddb23b3fc /net/sctp/socket.c | |
parent | f26f7c480555812ca7c4037e0a50fa54afe2cb4a (diff) |
[SCTP]: Fix the bind_addr info during migration.
During accept/migrate the code attempts to copy the addresses from
the parent endpoint to the new endpoint. However, if the parent
was bound to a wildcard address, then we end up pointlessly copying
all of the current addresses on the system.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 9f5d7930f54..ea9649ca0b2 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -6326,7 +6326,6 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, struct sk_buff *skb, *tmp; struct sctp_ulpevent *event; struct sctp_bind_hashbucket *head; - int flags = 0; /* Migrate socket buffer sizes and all the socket level options to the * new socket. @@ -6356,15 +6355,8 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, /* Copy the bind_addr list from the original endpoint to the new * endpoint so that we can handle restarts properly */ - if (PF_INET6 == assoc->base.sk->sk_family) - flags = SCTP_ADDR6_ALLOWED; - if (assoc->peer.ipv4_address) - flags |= SCTP_ADDR4_PEERSUPP; - if (assoc->peer.ipv6_address) - flags |= SCTP_ADDR6_PEERSUPP; - sctp_bind_addr_copy(&newsp->ep->base.bind_addr, - &oldsp->ep->base.bind_addr, - SCTP_SCOPE_GLOBAL, GFP_KERNEL, flags); + sctp_bind_addr_dup(&newsp->ep->base.bind_addr, + &oldsp->ep->base.bind_addr, GFP_KERNEL); /* Move any messages in the old socket's receive queue that are for the * peeled off association to the new socket's receive queue. |