diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index d50f610d1b02..dc22d7108494 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -359,7 +359,7 @@ static int sctp_v4_addr_valid(union sctp_addr *addr, | |||
359 | const struct sk_buff *skb) | 359 | const struct sk_buff *skb) |
360 | { | 360 | { |
361 | /* Is this a non-unicast address or a unusable SCTP address? */ | 361 | /* Is this a non-unicast address or a unusable SCTP address? */ |
362 | if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr)) | 362 | if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) |
363 | return 0; | 363 | return 0; |
364 | 364 | ||
365 | /* Is this a broadcast address? */ | 365 | /* Is this a broadcast address? */ |
@@ -408,13 +408,15 @@ static sctp_scope_t sctp_v4_scope(union sctp_addr *addr) | |||
408 | */ | 408 | */ |
409 | 409 | ||
410 | /* Check for unusable SCTP addresses. */ | 410 | /* Check for unusable SCTP addresses. */ |
411 | if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr)) { | 411 | if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) { |
412 | retval = SCTP_SCOPE_UNUSABLE; | 412 | retval = SCTP_SCOPE_UNUSABLE; |
413 | } else if (LOOPBACK(addr->v4.sin_addr.s_addr)) { | 413 | } else if (ipv4_is_loopback(addr->v4.sin_addr.s_addr)) { |
414 | retval = SCTP_SCOPE_LOOPBACK; | 414 | retval = SCTP_SCOPE_LOOPBACK; |
415 | } else if (IS_IPV4_LINK_ADDRESS(&addr->v4.sin_addr.s_addr)) { | 415 | } else if (ipv4_is_linklocal_169(addr->v4.sin_addr.s_addr)) { |
416 | retval = SCTP_SCOPE_LINK; | 416 | retval = SCTP_SCOPE_LINK; |
417 | } else if (IS_IPV4_PRIVATE_ADDRESS(&addr->v4.sin_addr.s_addr)) { | 417 | } else if (ipv4_is_private_10(addr->v4.sin_addr.s_addr) || |
418 | ipv4_is_private_172(addr->v4.sin_addr.s_addr) || | ||
419 | ipv4_is_private_192(addr->v4.sin_addr.s_addr)) { | ||
418 | retval = SCTP_SCOPE_PRIVATE; | 420 | retval = SCTP_SCOPE_PRIVATE; |
419 | } else { | 421 | } else { |
420 | retval = SCTP_SCOPE_GLOBAL; | 422 | retval = SCTP_SCOPE_GLOBAL; |