diff options
author | Patrick McHardy <kaber@trash.net> | 2014-01-03 07:16:18 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-01-07 17:57:31 -0500 |
commit | 4566bf27069b7780e453cffb24ea5f5323059885 (patch) | |
tree | 216307284d8588c3a1250dc01c956f4b40b9809c /net/netfilter | |
parent | 124edfa9e0451e97d621cd2796a44ff499e21036 (diff) |
netfilter: nft_meta: add l4proto support
For L3-proto independant rules we need to get at the L4 protocol value
directly. Add it to the nft_pktinfo struct and use the meta expression
to retrieve it.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-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 999d04688433..b43975a43309 100644 --- a/net/netfilter/nft_meta.c +++ b/net/netfilter/nft_meta.c | |||
@@ -46,6 +46,9 @@ static void nft_meta_get_eval(const struct nft_expr *expr, | |||
46 | case NFT_META_NFPROTO: | 46 | case NFT_META_NFPROTO: |
47 | dest->data[0] = pkt->ops->pf; | 47 | dest->data[0] = pkt->ops->pf; |
48 | break; | 48 | break; |
49 | case NFT_META_L4PROTO: | ||
50 | dest->data[0] = pkt->tprot; | ||
51 | break; | ||
49 | case NFT_META_PRIORITY: | 52 | case NFT_META_PRIORITY: |
50 | dest->data[0] = skb->priority; | 53 | dest->data[0] = skb->priority; |
51 | break; | 54 | break; |
@@ -185,6 +188,7 @@ static int nft_meta_init_validate_get(uint32_t key) | |||
185 | case NFT_META_LEN: | 188 | case NFT_META_LEN: |
186 | case NFT_META_PROTOCOL: | 189 | case NFT_META_PROTOCOL: |
187 | case NFT_META_NFPROTO: | 190 | case NFT_META_NFPROTO: |
191 | case NFT_META_L4PROTO: | ||
188 | case NFT_META_PRIORITY: | 192 | case NFT_META_PRIORITY: |
189 | case NFT_META_MARK: | 193 | case NFT_META_MARK: |
190 | case NFT_META_IIF: | 194 | case NFT_META_IIF: |