Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932540AbZKXJvS (ORCPT ); Tue, 24 Nov 2009 04:51:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932465AbZKXJvR (ORCPT ); Tue, 24 Nov 2009 04:51:17 -0500 Received: from stinky.trash.net ([213.144.137.162]:63668 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932460AbZKXJvQ (ORCPT ); Tue, 24 Nov 2009 04:51:16 -0500 Message-ID: <4B0BAC97.6010000@trash.net> Date: Tue, 24 Nov 2009 10:51:19 +0100 From: Patrick McHardy User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: Arnd Bergmann CC: Eric Dumazet , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, David Miller , Stephen Hemminger , Herbert Xu , Patrick Mullaney , "Eric W. Biederman" , Edge Virtual Bridging , Anna Fischer , bridge@lists.linux-foundation.org, virtualization@lists.linux-foundation.org, Jens Osterkamp , Gerhard Stenzel , Mark Smith Subject: Re: [PATCH 1/4] veth: move loopback logic to common location 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> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 966 Lines: 31 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/