netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-2.6.25 4/4] net/netfilter - Convert IP4 address class macros to inline functions
@ 2007-11-20  6:46 Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2007-11-20  6:46 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Pekka Savola (ipv6), Alexey Kuznetsov, Hideaki YOSHIFUJI,
	James Morris, Patrick McHardy

Change LOOPBACK MULTICAST LOCAL_MCAST BADCLASS and ZERONET
macros to inline functions is_ip4_[type](__be32 addr)

Adds some type safety and arguably some readability

No change in compiled image size

Signed-off-by: Joe Perches <joe@perches.com>

---

 net/netfilter/xt_pkttype.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/xt_pkttype.c b/net/netfilter/xt_pkttype.c
index a52925f..18c54ce 100644
--- a/net/netfilter/xt_pkttype.c
+++ b/net/netfilter/xt_pkttype.c
@@ -34,7 +34,7 @@ static bool match(const struct sk_buff *skb,
 	const struct xt_pkttype_info *info = matchinfo;
 
 	if (skb->pkt_type == PACKET_LOOPBACK)
-		type = MULTICAST(ip_hdr(skb)->daddr)
+		type = ipv4_is_multicast(ip_hdr(skb)->daddr)
 			? PACKET_MULTICAST
 			: PACKET_BROADCAST;
 	else



^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [PATCH net-2.6.25 4/4] net/netfilter - Convert IP4 address class macros to inline functions
@ 2007-11-14 15:53 Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2007-11-14 15:53 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Pekka Savola (ipv6), Alexey Kuznetsov, Hideaki YOSHIFUJI,
	James Morris, Patrick McHardy

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 <joe@perches.com>

---

 net/netfilter/xt_pkttype.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/xt_pkttype.c b/net/netfilter/xt_pkttype.c
index a52925f..18c54ce 100644
--- a/net/netfilter/xt_pkttype.c
+++ b/net/netfilter/xt_pkttype.c
@@ -34,7 +34,7 @@ static bool match(const struct sk_buff *skb,
 	const struct xt_pkttype_info *info = matchinfo;
 
 	if (skb->pkt_type == PACKET_LOOPBACK)
-		type = MULTICAST(ip_hdr(skb)->daddr)
+		type = is_ip4_multicast(ip_hdr(skb)->daddr)
 			? PACKET_MULTICAST
 			: PACKET_BROADCAST;
 	else



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-20  6:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-20  6:46 [PATCH net-2.6.25 4/4] net/netfilter - Convert IP4 address class macros to inline functions Joe Perches
  -- strict thread matches above, loose matches on Subject: below --
2007-11-14 15:53 Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).