diff options
author | Patrick McHardy <kaber@trash.net> | 2014-01-03 07:16:17 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-01-07 17:57:30 -0500 |
commit | 124edfa9e0451e97d621cd2796a44ff499e21036 (patch) | |
tree | d7c59ffc63c97113be80fcefeb14f85b62f22ee0 /net | |
parent | 1d49144c0aaa61be4e3ccbef9cc5c40b0ec5f2fe (diff) |
netfilter: nf_tables: add nfproto support to meta expression
Needed by multi-family tables to distinguish IPv4 and IPv6 packets.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nft_meta.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c index 1ceaaa6dfe72..999d04688433 100644 --- a/net/netfilter/nft_meta.c +++ b/net/netfilter/nft_meta.c | |||
@@ -43,6 +43,9 @@ static void nft_meta_get_eval(const struct nft_expr *expr, | |||
43 | case NFT_META_PROTOCOL: | 43 | case NFT_META_PROTOCOL: |
44 | *(__be16 *)dest->data = skb->protocol; | 44 | *(__be16 *)dest->data = skb->protocol; |
45 | break; | 45 | break; |
46 | case NFT_META_NFPROTO: | ||
47 | dest->data[0] = pkt->ops->pf; | ||
48 | break; | ||
46 | case NFT_META_PRIORITY: | 49 | case NFT_META_PRIORITY: |
47 | dest->data[0] = skb->priority; | 50 | dest->data[0] = skb->priority; |
48 | break; | 51 | break; |
@@ -181,6 +184,7 @@ static int nft_meta_init_validate_get(uint32_t key) | |||
181 | switch (key) { | 184 | switch (key) { |
182 | case NFT_META_LEN: | 185 | case NFT_META_LEN: |
183 | case NFT_META_PROTOCOL: | 186 | case NFT_META_PROTOCOL: |
187 | case NFT_META_NFPROTO: | ||
184 | case NFT_META_PRIORITY: | 188 | case NFT_META_PRIORITY: |
185 | case NFT_META_MARK: | 189 | case NFT_META_MARK: |
186 | case NFT_META_IIF: | 190 | case NFT_META_IIF: |