On 22 May 2016 at 20:05, Richard <tuxbox.guru@xxxxxxxxx> wrote: > Hi All, > > I have a netfilter_bridge hook kernel module working very well, but it > acts on all bridge interfaces. Not for a lack of trying to find a > method to find which will show me the name of the Bridge interface the > ingress/egress net_devices are a member of. > > Below is the hook (boiler plate prototype) - in->name = eth0, which is > what I need... but I also need to know what bridge eth0 is enslaved > in. > > unsigned int nf_icmp_forward_hook(unsigned int hooknum, > struct sk_buff* skb, > const struct net_device* in, > const struct net_device* out, > int (*okfn)(struct sk_buff*)); > > > How can I get the Bridge name that the IN devices is a member of. > > Any pointers would be greatly appreciated. > > > Regards, > Richard To answer, (and conclude the question) Thanks for all the help. rtnl_lock(); br_master = netdev_master_upper_dev_get((struct net_device *)in); rtnl_unlock(); Richard -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html