Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753098AbdCOK0o (ORCPT ); Wed, 15 Mar 2017 06:26:44 -0400 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:45022 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751487AbdCOK0m (ORCPT ); Wed, 15 Mar 2017 06:26:42 -0400 Date: Wed, 15 Mar 2017 11:26:08 +0100 From: Florian Westphal To: Linus =?iso-8859-15?Q?L=FCssing?= Cc: netdev@vger.kernel.org, "David S . Miller" , Stephen Hemminger , Pablo Neira Ayuso , Jozsef Kadlecsik , bridge@lists.linux-foundation.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] bridge: ebtables: fix reception of frames DNAT-ed to bridge device Message-ID: <20170315102608.GB24366@breakpoint.cc> References: <20170315031811.22714-1-linus.luessing@c0d3.blue> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170315031811.22714-1-linus.luessing@c0d3.blue> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 902 Lines: 25 Linus L?ssing wrote: > When trying to redirect bridged frames to the bridge device itself > via the ebtables nat-prerouting chain and the dnat target then this > currently fails: > > The ethernet destination of the frame is dnat'ed to the MAC address of > the bridge itself just fine and the correctly altered frame can even > be captured via a tcpdump on br0 (with or without promisc mode). > > However, the IP code drops it in the beginning of ip_input.c/ip_rcv() > as the dnat target did not update the skb->pkt_type. Right, thats the reason why ebtables also has ebt_redirect target which does this pkt_type fixup. > - if (dst->is_local) > + if (dst->is_local) { > + /* fix up potential DNAT mess */ > + skb->pkt_type = PACKET_HOST; > + > return br_pass_frame_up(skb); > + } I don't mind this change though (i.e. I don't see how this would bite us later).