From patchwork Tue Nov 24 10:02:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 39196 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id AC919B6EE8 for ; Tue, 24 Nov 2009 21:04:36 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932583AbZKXKDu (ORCPT ); Tue, 24 Nov 2009 05:03:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932556AbZKXKDu (ORCPT ); Tue, 24 Nov 2009 05:03:50 -0500 Received: from moutng.kundenserver.de ([212.227.17.9]:62797 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932371AbZKXKDt (ORCPT ); Tue, 24 Nov 2009 05:03:49 -0500 Received: from wuerfel.localnet (port-92-200-14-72.dynamic.qsc.de [92.200.14.72]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MOU8z-1NI6tG1nt7-005zI6; Tue, 24 Nov 2009 11:02:25 +0100 From: Arnd Bergmann To: Patrick McHardy Subject: Re: [PATCH 1/4] veth: move loopback logic to common location Date: Tue, 24 Nov 2009 10:02:20 +0000 User-Agent: KMail/1.12.2 (Linux/2.6.31bisect; KDE/4.3.2; x86_64; ; ) 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 References: <1259024166-28158-1-git-send-email-arnd@arndb.de> <1259024166-28158-2-git-send-email-arnd@arndb.de> <4B0BAC97.6010000@trash.net> In-Reply-To: <4B0BAC97.6010000@trash.net> MIME-Version: 1.0 Message-Id: <200911241002.20904.arnd@arndb.de> X-Provags-ID: V01U2FsdGVkX1+kFr4mD15/7C3jE/DIKKqroOqpH13MwUtAkf9 mnTMkwZzXScQmooyijsTqg3kYAnLJSllD2AwbuNPFg8P9lMTlG XJyzmGUvXdi5PNTHwN94w== Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tuesday 24 November 2009 09:51:19 Patrick McHardy wrote: > > + 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. But isn't that what we want in macvlan as well when we're forwarding from one downstream interface to another? I did all my testing with macvlan interfaces in separate namespaces communicating with each other, so I'd assume that we should always clear skb->mark and skb->dst in this function. Maybe I should make the documentation clearer? --- net: clarify documentation of dev_forward_skb Signed-off-by: Arnd Bergmann -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1433,6 +1433,10 @@ static inline void net_timestamp(struct sk_buff *skb) * dev_forward_skb can be used for injecting an skb from the * start_xmit function of one device into the receive queue * of another device. + * + * The receiving device may be in another namespace, so + * we have to clear all information in the skb that could + * impact namespace isolation. */ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) {