History

netfilter: meta: add PRANDOM support

Can be used to randomly match packets e.g. for statistic traffic sampling. See commit 3ad0040573b0c00f8848 ("bpf: split state from prandom_u32() and consolidate {c, e}BPF prngs") for more info why this doesn't use prandom_u32 directly. Unlike bpf nft_meta can be built as a module, so add an EXPORT_SYMBOL for prandom_seed_full_state too.

Florian Westphal committed 10 years ago

Commit b07edbe1 parent f12d33f3 files · +14 −0Browse files

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

Unified · Split

include/uapi/linux/netfilter/nf_tables.h+2−0
@@ -681,6 +681,7 @@ enum nft_exthdr_attributes { · 680 unmodified lines
681 * @NFT_META_IIFGROUP: packet input interface group681 * @NFT_META_IIFGROUP: packet input interface group
682 * @NFT_META_OIFGROUP: packet output interface group682 * @NFT_META_OIFGROUP: packet output interface group
683 * @NFT_META_CGROUP: socket control group (skb->sk->sk_classid)683 * @NFT_META_CGROUP: socket control group (skb->sk->sk_classid)
684 * @NFT_META_PRANDOM: a 32bit pseudo-random number
684 */685 */
685enum nft_meta_keys {686enum nft_meta_keys {
686 NFT_META_LEN,687 NFT_META_LEN,
@@ -707,6 +708,7 @@ enum nft_meta_keys { · 20 unmodified lines
707 NFT_META_IIFGROUP,708 NFT_META_IIFGROUP,
708 NFT_META_OIFGROUP,709 NFT_META_OIFGROUP,
709 NFT_META_CGROUP,710 NFT_META_CGROUP,
711 NFT_META_PRANDOM,
710};712};
711 713
712/**714/**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t