netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Netfilter_Bridge parent bridge name in hook
@ 2016-05-22 19:05 Richard
  2016-05-28  8:11 ` Richard
  0 siblings, 1 reply; 2+ messages in thread
From: Richard @ 2016-05-22 19:05 UTC (permalink / raw)
  To: netfilter-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Netfilter_Bridge parent bridge name in hook
  2016-05-22 19:05 Netfilter_Bridge parent bridge name in hook Richard
@ 2016-05-28  8:11 ` Richard
  0 siblings, 0 replies; 2+ messages in thread
From: Richard @ 2016-05-28  8:11 UTC (permalink / raw)
  To: netfilter-devel

On 22 May 2016 at 20:05, Richard <tuxbox.guru@gmail.com> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-28  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-22 19:05 Netfilter_Bridge parent bridge name in hook Richard
2016-05-28  8:11 ` Richard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).