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
4141 int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid,
4242 int flags);
4343
44+static inline u16 nfnl_msg_type(u8 subsys, u8 msg_type)
45+{
46+ return subsys << 8 | msg_type;
47+}
48+
4449 void nfnl_lock(__u8 subsys_id);
4550 void nfnl_unlock(__u8 subsys_id);
4651 #ifdef CONFIG_PROVE_LOCKING