Skip to contentSkip to conversation

netfilter: nft_fwd_netdev: allow to forward packets via neighbour layer

PATCH In review Pablo Neira Ayuso 2 participants 2 messages Nov 10, 2017

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nft_fwd_netdev: allow to forward packets via neighbour layer

This allows us to forward packets from the netdev family via neighbour layer, so you don't need an explicit link-layer destination when using this expression from rules.

---
 include/uapi/linux/netfilter/nf_tables.h |   4 ++
 net/netfilter/nft_fwd_netdev.c           | 114 ++++++++++++++++++++++++++++++-
 2 files changed, 117 insertions(+), 1 deletion(-)
include/uapi/linux/netfilter/nf_tables.h +4 -0
index 871afa4871bf..dbea045bdc2d 100644
@@ -1190,10 +1190,14 @@ enum nft_dup_attributes {
  * enum nft_fwd_attributes - nf_tables fwd expression netlink attributes
  *
  * @NFTA_FWD_SREG_DEV: source register of output interface (NLA_U32: nft_register)
+ * @NFTA_FWD_SREG_ADDR: source register of destination address (NLA_U32: nft_register)
+ * @NFTA_FWD_NFPROTO: layer 3 family of source register address (NLA_U32: enum nfproto)
  */
 enum nft_fwd_attributes {
 	NFTA_FWD_UNSPEC,
 	NFTA_FWD_SREG_DEV,
+	NFTA_FWD_SREG_ADDR,
+	NFTA_FWD_NFPROTO,
 	__NFTA_FWD_MAX
 };
 #define NFTA_FWD_MAX	(__NFTA_FWD_MAX - 1)
net/netfilter/nft_fwd_netdev.c +113 -1

142 lines not on this page · raw message

Signature · 1 line
2.11.0
maintainer
#1 lore raw
Quoted 3 lines · Pablo Neira Ayuso

This allows us to forward packets from the netdev family via neighbour layer, so you don't need an explicit link-layer destination when using this expression from rules.

Should this decrement ttl?
Or should we add extra expression for that?