Change LOOPBACK MULTICAST LOCAL_MCAST BADCLASS and ZERONET macros to inline functions is_ip4_[type](__be32 addr) Adds some type safety and maybe some readability
No change in compiled image size Signed-off-by: Joe Perches <[EMAIL PROTECTED]> --- net/core/netpoll.c | 2 +- net/core/pktgen.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/core/netpoll.c b/net/core/netpoll.c index c499b5c..bf9b4db 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -418,7 +418,7 @@ static void arp_reply(struct sk_buff *skb) memcpy(&tip, arp_ptr, 4); /* Should we ignore arp? */ - if (tip != htonl(np->local_ip) || LOOPBACK(tip) || MULTICAST(tip)) + if (tip != htonl(np->local_ip) || is_ip4_loopback(tip) || is_ip4_multicast(tip)) return; size = sizeof(struct arphdr) + 2 * (skb->dev->addr_len + 4); diff --git a/net/core/pktgen.c b/net/core/pktgen.c index de33f36..0d5ef00 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2358,9 +2358,9 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev) t = random32() % (imx - imn) + imn; s = htonl(t); - while (LOOPBACK(s) || MULTICAST(s) - || BADCLASS(s) || ZERONET(s) - || LOCAL_MCAST(s)) { + while (is_ip4_loopback(s) || is_ip4_multicast(s) + || is_ip4_badclass(s) || is_ip4_zeronet(s) + || is_ip4_local_multicast(s)) { t = random32() % (imx - imn) + imn; s = htonl(t); } - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html