From patchwork Wed Jun 16 23:10:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 225 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id 61CE7154361 for ; Thu, 17 Jun 2010 01:10:20 +0200 (CEST) Received: (qmail invoked by alias); 16 Jun 2010 23:10:19 -0000 Received: from i59F6BE66.versanet.de (EHLO sven-desktop.lazhur.ath.cx) [89.246.190.102] by mail.gmx.net (mp072) with SMTP; 17 Jun 2010 01:10:19 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1/cluMotoPcckxTx6PZ4qOAaTCLMxz5nHeZMmWxLJ dmnvLlYXyyp3ZZ From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 17 Jun 2010 01:10:17 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.34-1-amd64; KDE/4.4.4; x86_64; ; ) References: <1276727961-18719-1-git-send-email-sven.eckelmann@gmx.de> <201006170042.13864.sven.eckelmann@gmx.de> <201006170052.18499.lindner_marek@yahoo.de> In-Reply-To: <201006170052.18499.lindner_marek@yahoo.de> MIME-Version: 1.0 Message-Id: <201006170110.19294.sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Cc: Marek Lindner Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use rx_handler_data pointer to store net_bridge_port pointer X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 23:10:20 -0000 Marek Lindner wrote: > On Thursday 17 June 2010 00:42:11 Sven Eckelmann wrote: > > I have merged it into maint (not into trunk), but somebody has to think > > about a way to to get it working on older kernels. This patch has to > > made on top of that patch to get it integrated into the next kernel > > merge window. > > The code in question has not been enabled yet. It is just there as a > possibility and could be enabled if it makes sense. I would say the one > activating this code has to deal with the backward compatibility when it > happens, ok ? :-) Ok, let me rewrite it: I have merged it into maint (not in trunk) but somebody has to think about a way to get it working on olders kernel _when he wants to enable it the future_. This patch has to made on top of that patch to get it integrated in _one of the next kernel merge windows_. Better? :P Personally I would do it with something like that: Best regards, Sven diff --git a/batman-adv-kernelland/compat.h b/batman-adv-kernelland/compat.h index 8302a58..c503a51 100644 --- a/batman-adv-kernelland/compat.h +++ b/batman-adv-kernelland/compat.h @@ -232,3 +232,14 @@ static inline struct net_device_stats *dev_get_stats(struct net_device *dev) } #endif /* < KERNEL_VERSION(2, 6, 29) */ + +#if !defined(IFF_BRIDGE_PORT) + +#ifdef netdev_isbridged +#undef netdev_isbridged +#endif + +#define netdev_isbridged(netdev) \ + ((net_dev)->br_port != NULL) + +#endif /* defined(IFF_BRIDGE_PORT) */ diff --git a/batman-adv-kernelland/hard-interface.c b/batman-adv-kernelland/hard-interface.c index 0773420..183d4c9 100644 --- a/batman-adv-kernelland/hard-interface.c +++ b/batman-adv-kernelland/hard-interface.c @@ -74,7 +74,7 @@ static int is_valid_iface(struct net_device *net_dev) #endif /* Device is being bridged */ - /* if (net_dev->priv_flags & IFF_BRIDGE_PORT) + /* if (netdev_isbridged(net_dev)) return 0; */ return 1; diff --git a/batman-adv-kernelland/hard-interface.h b/batman-adv-kernelland/hard-interface.h index 1e5fc3e..9bd1837 100644 --- a/batman-adv-kernelland/hard-interface.h +++ b/batman-adv-kernelland/hard-interface.h @@ -38,3 +38,8 @@ int batman_skb_recv(struct sk_buff *skb, struct net_device *orig_dev); int hardif_min_mtu(void); void update_min_mtu(void); + +#ifndef netdev_isbridged +#define netdev_isbridged(netdev) \ + ((net_dev)->priv_flags & IFF_BRIDGE_PORT) +#endif