aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2007-12-16 16:46:59 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:58:17 -0500
commitb5cb2bbc4c6cb489941be881e8adfe136ee45b8e (patch)
treef7a1280cfb46609910d8e6189bc96edc5375b645 /net/sctp
parent37ef8dd7f3f2f228336e3779e7cec762d90e1f00 (diff)
[IPV4] sctp: Use ipv4_is_<type>
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/protocol.c12
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;