From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 19 Apr 2016 04:22:18 +0200 From: Linus =?utf-8?Q?L=C3=BCssing?= Message-ID: <20160419022218.GE17647@otheros> References: <1458101205-26316-1-git-send-email-linus.luessing@c0d3.blue> <1458101205-26316-3-git-send-email-linus.luessing@c0d3.blue> <3374405.0Pi9Duaxya@bentobox> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3374405.0Pi9Duaxya@bentobox> Subject: Re: [B.A.T.M.A.N.] [PATCHv12 2/4] batman-adv: Add multicast optimization support for bridged setups List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: The list for a Better Approach To Mobile Ad-hoc Networking On Thu, Apr 07, 2016 at 03:50:39PM +0200, Sven Eckelmann wrote: > On Wednesday 16 March 2016 05:06:43 Linus Lüssing wrote: > > --- /dev/null > > +++ b/compat-sources/net/bridge/br_multicast.c > > @@ -0,0 +1,33 @@ > > +#include > > +#include > > + > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) || \ > > + LINUX_VERSION_CODE == KERNEL_VERSION(3, 16, 0) && \ > > + (!IS_ENABLED(CONFIG_BRIDGE) || \ > > + !IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING)) > > + > > +int br_multicast_list_adjacent(struct net_device *dev, > > + struct list_head *br_ip_list) > > +{ > > + return 0; > > +} > > + > > +bool br_multicast_has_querier_adjacent(struct net_device *dev, int proto) > > +{ > > + return false; > > +} > > + > > +#endif /* < KERNEL_VERSION(3, 16, 0) || > > + * !IS_ENABLED(CONFIG_BRIDGE) || > > + * !IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) */ > > + > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) > > + > > +bool br_multicast_has_querier_anywhere(struct net_device *dev, int proto) > > +{ > > + pr_warn_once("Old kernel detected (< 3.17) - multicast optimizations disabled\n"); > > + > > + return false; > > +} > > + > > +#endif /* < KERNEL_VERSION(3, 17, 0) */ > > Why must there be a special compat-sources/*.c file for these tiny > functions? I think it is necessary because of the missing stubs in 3.16. 3.16 has the function declarations in if_bridge.h but without function definitions if the kernel is build without bridge (snooping) support. Adding simple inline functions in compat-include/linux/if_bridge.h for these functions would yield a compile-time error for the 3.16 kernel without bridge (snooping) support case: The declaration is always there in 3.16's if_bridge.h include which would clash with a self-made inline function in our compat-include's if_bridge.h.