History

netfilter: Add nfnl_msg_type() helper function

Add and use nfnl_msg_type() function to replace opencoded nfnetlink message type. I suggested this change, Arushi Singhal made an initial patch to address this but was missing several spots.

Pablo Neira Ayuso committed 9 years ago

Commit dedb67c1 parent 2c62e0b11 files · +33 −27Browse files

Showing the changes to include/linux/netfilter (1 of 11 files). Show all

Unified · Split

include/linux/netfilter/nfnetlink.h+5−0
@@ -41,6 +41,11 @@ int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error); · 40 unmodified lines
41int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid,41int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid,
42 int flags);42 int flags);
43 43
44static inline u16 nfnl_msg_type(u8 subsys, u8 msg_type)
45{
46 return subsys << 8 | msg_type;
47}
48
44void nfnl_lock(__u8 subsys_id);49void nfnl_lock(__u8 subsys_id);
45void nfnl_unlock(__u8 subsys_id);50void nfnl_unlock(__u8 subsys_id);
46#ifdef CONFIG_PROVE_LOCKING51#ifdef CONFIG_PROVE_LOCKING