diff options
Diffstat (limited to 'net/sctp/bind_addr.c')
-rw-r--r-- | net/sctp/bind_addr.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index f62bc2468935..6d5944a745d4 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c | |||
@@ -457,7 +457,7 @@ static int sctp_copy_one_addr(struct sctp_bind_addr *dest, | |||
457 | { | 457 | { |
458 | int error = 0; | 458 | int error = 0; |
459 | 459 | ||
460 | if (sctp_is_any(addr)) { | 460 | if (sctp_is_any(NULL, addr)) { |
461 | error = sctp_copy_local_addr_list(dest, scope, gfp, flags); | 461 | error = sctp_copy_local_addr_list(dest, scope, gfp, flags); |
462 | } else if (sctp_in_scope(addr, scope)) { | 462 | } else if (sctp_in_scope(addr, scope)) { |
463 | /* Now that the address is in scope, check to see if | 463 | /* Now that the address is in scope, check to see if |
@@ -477,11 +477,21 @@ static int sctp_copy_one_addr(struct sctp_bind_addr *dest, | |||
477 | } | 477 | } |
478 | 478 | ||
479 | /* Is this a wildcard address? */ | 479 | /* Is this a wildcard address? */ |
480 | int sctp_is_any(const union sctp_addr *addr) | 480 | int sctp_is_any(struct sock *sk, const union sctp_addr *addr) |
481 | { | 481 | { |
482 | struct sctp_af *af = sctp_get_af_specific(addr->sa.sa_family); | 482 | unsigned short fam = 0; |
483 | struct sctp_af *af; | ||
484 | |||
485 | /* Try to get the right address family */ | ||
486 | if (addr->sa.sa_family != AF_UNSPEC) | ||
487 | fam = addr->sa.sa_family; | ||
488 | else if (sk) | ||
489 | fam = sk->sk_family; | ||
490 | |||
491 | af = sctp_get_af_specific(fam); | ||
483 | if (!af) | 492 | if (!af) |
484 | return 0; | 493 | return 0; |
494 | |||
485 | return af->is_any(addr); | 495 | return af->is_any(addr); |
486 | } | 496 | } |
487 | 497 | ||