[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>
This commit is contained in:
committed by
David S. Miller
parent
37ef8dd7f3
commit
b5cb2bbc4c
@@ -359,7 +359,7 @@ static int sctp_v4_addr_valid(union sctp_addr *addr,
|
||||
const struct sk_buff *skb)
|
||||
{
|
||||
/* Is this a non-unicast address or a unusable SCTP address? */
|
||||
if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr))
|
||||
if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr))
|
||||
return 0;
|
||||
|
||||
/* Is this a broadcast address? */
|
||||
@@ -408,13 +408,15 @@ static sctp_scope_t sctp_v4_scope(union sctp_addr *addr)
|
||||
*/
|
||||
|
||||
/* Check for unusable SCTP addresses. */
|
||||
if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr)) {
|
||||
if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) {
|
||||
retval = SCTP_SCOPE_UNUSABLE;
|
||||
} else if (LOOPBACK(addr->v4.sin_addr.s_addr)) {
|
||||
} else if (ipv4_is_loopback(addr->v4.sin_addr.s_addr)) {
|
||||
retval = SCTP_SCOPE_LOOPBACK;
|
||||
} else if (IS_IPV4_LINK_ADDRESS(&addr->v4.sin_addr.s_addr)) {
|
||||
} else if (ipv4_is_linklocal_169(addr->v4.sin_addr.s_addr)) {
|
||||
retval = SCTP_SCOPE_LINK;
|
||||
} else if (IS_IPV4_PRIVATE_ADDRESS(&addr->v4.sin_addr.s_addr)) {
|
||||
} else if (ipv4_is_private_10(addr->v4.sin_addr.s_addr) ||
|
||||
ipv4_is_private_172(addr->v4.sin_addr.s_addr) ||
|
||||
ipv4_is_private_192(addr->v4.sin_addr.s_addr)) {
|
||||
retval = SCTP_SCOPE_PRIVATE;
|
||||
} else {
|
||||
retval = SCTP_SCOPE_GLOBAL;
|
||||
|
Reference in New Issue
Block a user