Commit f703651ef870bd6b94ddc98ae07488b7d3fd9335

Authored by Jozsef Kadlecsik
Committed by Patrick McHardy
1 parent 6a4ddef2a3

netfilter: NFNL_SUBSYS_IPSET id and NLA_PUT_NET* macros

The patch adds the NFNL_SUBSYS_IPSET id and NLA_PUT_NET* macros to the
vanilla kernel.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>

Showing 2 changed files with 11 additions and 1 deletions Side-by-side Diff

include/linux/netfilter/nfnetlink.h
... ... @@ -47,7 +47,8 @@
47 47 #define NFNL_SUBSYS_QUEUE 3
48 48 #define NFNL_SUBSYS_ULOG 4
49 49 #define NFNL_SUBSYS_OSF 5
50   -#define NFNL_SUBSYS_COUNT 6
  50 +#define NFNL_SUBSYS_IPSET 6
  51 +#define NFNL_SUBSYS_COUNT 7
51 52  
52 53 #ifdef __KERNEL__
53 54  
include/net/netlink.h
... ... @@ -856,17 +856,26 @@
856 856 #define NLA_PUT_BE16(skb, attrtype, value) \
857 857 NLA_PUT_TYPE(skb, __be16, attrtype, value)
858 858  
  859 +#define NLA_PUT_NET16(skb, attrtype, value) \
  860 + NLA_PUT_BE16(skb, attrtype | NLA_F_NET_BYTEORDER, value)
  861 +
859 862 #define NLA_PUT_U32(skb, attrtype, value) \
860 863 NLA_PUT_TYPE(skb, u32, attrtype, value)
861 864  
862 865 #define NLA_PUT_BE32(skb, attrtype, value) \
863 866 NLA_PUT_TYPE(skb, __be32, attrtype, value)
864 867  
  868 +#define NLA_PUT_NET32(skb, attrtype, value) \
  869 + NLA_PUT_BE32(skb, attrtype | NLA_F_NET_BYTEORDER, value)
  870 +
865 871 #define NLA_PUT_U64(skb, attrtype, value) \
866 872 NLA_PUT_TYPE(skb, u64, attrtype, value)
867 873  
868 874 #define NLA_PUT_BE64(skb, attrtype, value) \
869 875 NLA_PUT_TYPE(skb, __be64, attrtype, value)
  876 +
  877 +#define NLA_PUT_NET64(skb, attrtype, value) \
  878 + NLA_PUT_BE64(skb, attrtype | NLA_F_NET_BYTEORDER, value)
870 879  
871 880 #define NLA_PUT_STRING(skb, attrtype, value) \
872 881 NLA_PUT(skb, attrtype, strlen(value) + 1, value)