[PATCH 1/4] net: netfilter: add nf_inet_addr_mask_inplace helper fn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adds new  helper function to be used for ipset nf_inet_addr netmask support.

Signed-off-by: Josh Hunt <johunt@xxxxxxxxxx>
---
 include/linux/netfilter.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index a4b97be..4218969 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -39,6 +39,15 @@ static inline void nf_inet_addr_mask(const union nf_inet_addr *a1,
 	result->all[3] = a1->all[3] & mask->all[3];
 }
 
+static inline void nf_inet_addr_mask_inplace(union nf_inet_addr *a1,
+					     const union nf_inet_addr *mask)
+{
+	a1->all[0] &= mask->all[0];
+	a1->all[1] &= mask->all[1];
+	a1->all[2] &= mask->all[2];
+	a1->all[3] &= mask->all[3];
+}
+
 int netfilter_init(void);
 
 struct sk_buff;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux