batman-adv: use rx_handler_data pointer to store net_bridge_port pointer
Commit Message
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
Comments
> --- 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
Maybe this could be pushed upstream? Seems like a useful bit of code
in general?
Andrew
Andrew Lunn wrote:
> > --- 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
>
> Maybe this could be pushed upstream? Seems like a useful bit of code
> in general?
I don't think so. It is only used in ~7 places in the whole kernel. If you
want then please feel free to add something like this and submit it to David
S. Miller.
Best regards,
Sven
On Thursday 17 June 2010 01:10:17 Sven Eckelmann wrote:
> 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_.
Ok, I think we are on the same page then. :-)
I applied the patch (revision 1699).
Thanks,
Marek
@@ -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) */
@@ -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;
@@ -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