Skip to content

Commit f703651

Browse files
Jozsef Kadlecsikkaber
authored andcommitted
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>
1 parent 6a4ddef commit f703651

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

include/linux/netfilter/nfnetlink.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ struct nfgenmsg {
4747
#define NFNL_SUBSYS_QUEUE 3
4848
#define NFNL_SUBSYS_ULOG 4
4949
#define NFNL_SUBSYS_OSF 5
50-
#define NFNL_SUBSYS_COUNT 6
50+
#define NFNL_SUBSYS_IPSET 6
51+
#define NFNL_SUBSYS_COUNT 7
5152

5253
#ifdef __KERNEL__
5354

include/net/netlink.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,18 +856,27 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
856856
#define NLA_PUT_BE16(skb, attrtype, value) \
857857
NLA_PUT_TYPE(skb, __be16, attrtype, value)
858858

859+
#define NLA_PUT_NET16(skb, attrtype, value) \
860+
NLA_PUT_BE16(skb, attrtype | NLA_F_NET_BYTEORDER, value)
861+
859862
#define NLA_PUT_U32(skb, attrtype, value) \
860863
NLA_PUT_TYPE(skb, u32, attrtype, value)
861864

862865
#define NLA_PUT_BE32(skb, attrtype, value) \
863866
NLA_PUT_TYPE(skb, __be32, attrtype, value)
864867

868+
#define NLA_PUT_NET32(skb, attrtype, value) \
869+
NLA_PUT_BE32(skb, attrtype | NLA_F_NET_BYTEORDER, value)
870+
865871
#define NLA_PUT_U64(skb, attrtype, value) \
866872
NLA_PUT_TYPE(skb, u64, attrtype, value)
867873

868874
#define NLA_PUT_BE64(skb, attrtype, value) \
869875
NLA_PUT_TYPE(skb, __be64, attrtype, value)
870876

877+
#define NLA_PUT_NET64(skb, attrtype, value) \
878+
NLA_PUT_BE64(skb, attrtype | NLA_F_NET_BYTEORDER, value)
879+
871880
#define NLA_PUT_STRING(skb, attrtype, value) \
872881
NLA_PUT(skb, attrtype, strlen(value) + 1, value)
873882

0 commit comments

Comments
 (0)