From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4B0BAC97.6010000@trash.net> Date: Tue, 24 Nov 2009 10:51:19 +0100 From: Patrick McHardy MIME-Version: 1.0 References: <1259024166-28158-1-git-send-email-arnd@arndb.de> <1259024166-28158-2-git-send-email-arnd@arndb.de> In-Reply-To: <1259024166-28158-2-git-send-email-arnd@arndb.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Bridge] [PATCH 1/4] veth: move loopback logic to common location List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Arnd Bergmann Cc: Herbert Xu , Eric Dumazet , Anna Fischer , netdev@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Mark Smith , Gerhard Stenzel , "Eric W. Biederman" , Jens Osterkamp , Patrick Mullaney , Stephen Hemminger , Edge Virtual Bridging , David Miller Arnd Bergmann wrote: > +int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) > +{ > + skb_orphan(skb); > + > + if (!(dev->flags & IFF_UP)) > + return NET_RX_DROP; > + > + if (skb->len > (dev->mtu + dev->hard_header_len)) > + return NET_RX_DROP; > + > + skb_dst_drop(skb); > + skb->tstamp.tv64 = 0; > + skb->pkt_type = PACKET_HOST; > + skb->protocol = eth_type_trans(skb, dev); > + skb->mark = 0; skb->mark clearing should stay private to veth since its usually supposed to stay intact. The only exception is packets crossing namespaces, where they should appear like a freshly received skbs. > + secpath_reset(skb); > + nf_reset(skb); > + return netif_rx(skb); > +} > +EXPORT_SYMBOL_GPL(dev_forward_skb);