Commit 5f158939 authored by Arturo Borrero's avatar Arturo Borrero Committed by Pablo Neira Ayuso

netfilter: nft_compat: add support for arptables extensions

This patch adds support to arptables extensions from nft_compat.
Signed-off-by: default avatarArturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent d752c364
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/netfilter_ipv4/ip_tables.h> #include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv6/ip6_tables.h> #include <linux/netfilter_ipv6/ip6_tables.h>
#include <linux/netfilter_bridge/ebtables.h> #include <linux/netfilter_bridge/ebtables.h>
#include <linux/netfilter_arp/arp_tables.h>
#include <net/netfilter/nf_tables.h> #include <net/netfilter/nf_tables.h>
static int nft_compat_chain_validate_dependency(const char *tablename, static int nft_compat_chain_validate_dependency(const char *tablename,
...@@ -42,6 +43,7 @@ union nft_entry { ...@@ -42,6 +43,7 @@ union nft_entry {
struct ipt_entry e4; struct ipt_entry e4;
struct ip6t_entry e6; struct ip6t_entry e6;
struct ebt_entry ebt; struct ebt_entry ebt;
struct arpt_entry arp;
}; };
static inline void static inline void
...@@ -140,6 +142,8 @@ nft_target_set_tgchk_param(struct xt_tgchk_param *par, ...@@ -140,6 +142,8 @@ nft_target_set_tgchk_param(struct xt_tgchk_param *par,
entry->ebt.ethproto = proto; entry->ebt.ethproto = proto;
entry->ebt.invflags = inv ? EBT_IPROTO : 0; entry->ebt.invflags = inv ? EBT_IPROTO : 0;
break; break;
case NFPROTO_ARP:
break;
} }
par->entryinfo = entry; par->entryinfo = entry;
par->target = target; par->target = target;
...@@ -351,6 +355,8 @@ nft_match_set_mtchk_param(struct xt_mtchk_param *par, const struct nft_ctx *ctx, ...@@ -351,6 +355,8 @@ nft_match_set_mtchk_param(struct xt_mtchk_param *par, const struct nft_ctx *ctx,
entry->ebt.ethproto = proto; entry->ebt.ethproto = proto;
entry->ebt.invflags = inv ? EBT_IPROTO : 0; entry->ebt.invflags = inv ? EBT_IPROTO : 0;
break; break;
case NFPROTO_ARP:
break;
} }
par->entryinfo = entry; par->entryinfo = entry;
par->match = match; par->match = match;
...@@ -537,6 +543,9 @@ nfnl_compat_get(struct sock *nfnl, struct sk_buff *skb, ...@@ -537,6 +543,9 @@ nfnl_compat_get(struct sock *nfnl, struct sk_buff *skb,
case NFPROTO_BRIDGE: case NFPROTO_BRIDGE:
fmt = "ebt_%s"; fmt = "ebt_%s";
break; break;
case NFPROTO_ARP:
fmt = "arpt_%s";
break;
default: default:
pr_err("nft_compat: unsupported protocol %d\n", pr_err("nft_compat: unsupported protocol %d\n",
nfmsg->nfgen_family); nfmsg->nfgen_family);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment