History

netfilter: nfnetlink_queue: enable UID/GID socket info retrieval

Thanks to commits 41063e9 (ipv4: Early TCP socket demux) and 421b388 (udp: ipv4: Add udp early demux) it is now possible to parse UID and GID socket info also for incoming TCP and UDP connections. Having this info available, it is convenient to let NFQUEUE parse it in order to improve and refine the traffic analysis in userspace.

Valentina Giusti committed 12 years ago

Commit 08c0cad1 parent 534473c2 files · +38 −1Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/netfilter/nfnetlink_queue.h+4−1
@@ -47,6 +47,8 @@ enum nfqnl_attr_type { · 46 unmodified lines
4747 NFQA_CAP_LEN, /* __u32 length of captured packet */
4848 NFQA_SKB_INFO, /* __u32 skb meta information */
4949 NFQA_EXP, /* nf_conntrack_netlink.h */
50+ NFQA_UID, /* __u32 sk uid */
51+ NFQA_GID, /* __u32 sk gid */
5052
5153 __NFQA_MAX
5254 };
@@ -99,7 +101,8 @@ enum nfqnl_attr_config { · 46 unmodified lines
99101 #define NFQA_CFG_F_FAIL_OPEN (1 << 0)
100102 #define NFQA_CFG_F_CONNTRACK (1 << 1)
101103 #define NFQA_CFG_F_GSO (1 << 2)
102−#define NFQA_CFG_F_MAX (1 << 3)
104+#define NFQA_CFG_F_UID_GID (1 << 3)
105+#define NFQA_CFG_F_MAX (1 << 4)
103106
104107 /* flags for NFQA_SKB_INFO */
105108 /* packet appears to have wrong checksums, but they are ok */