bridge: ebtables: fix reception of frames DNAT-ed to bridge device/port
authorLinus Lüssing <linus.luessing@c0d3.blue>
Wed, 19 Apr 2017 19:47:33 +0000 (21:47 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 25 Apr 2017 09:08:31 +0000 (11:08 +0200)
commitcf3cb246e277d98987aa8d62ef2730dbee2f5fa7
tree89f0a719c5563cd04a50d2d009160b3c34004824
parent6bd3d1929246bb0cf4f3bd6e25a0ba442b0de845
bridge: ebtables: fix reception of frames DNAT-ed to bridge device/port

When trying to redirect bridged frames to the bridge device itself or
a bridge port (brouting) via the dnat target then this currently fails:

The ethernet destination of the frame is dnat'ed to the MAC address of
the bridge device or port just fine. However, the IP code drops it in
the beginning of ip_input.c/ip_rcv() as the dnat target left
the skb->pkt_type as PACKET_OTHERHOST.

Fixing this by resetting skb->pkt_type to an appropriate type after
dnat'ing.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/bridge/netfilter/ebt_dnat.c