lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141125151312.GC27416@gospo.rtplab.test>
Date:	Tue, 25 Nov 2014 10:13:12 -0500
From:	Andy Gospodarek <gospo@...ulusnetworks.com>
To:	Jiri Pirko <jiri@...nulli.us>
Cc:	netdev@...r.kernel.org, davem@...emloft.net, nhorman@...driver.com,
	andy@...yhouse.net, tgraf@...g.ch, dborkman@...hat.com,
	ogerlitz@...lanox.com, jesse@...ira.com, pshelar@...ira.com,
	azhou@...ira.com, ben@...adent.org.uk, stephen@...workplumber.org,
	jeffrey.t.kirsher@...el.com, vyasevic@...hat.com,
	xiyou.wangcong@...il.com, john.r.fastabend@...el.com,
	edumazet@...gle.com, jhs@...atatu.com, sfeldma@...il.com,
	f.fainelli@...il.com, roopa@...ulusnetworks.com,
	linville@...driver.com, jasowang@...hat.com, ebiederm@...ssion.com,
	nicolas.dichtel@...nd.com, ryazanov.s.a@...il.com,
	buytenh@...tstofly.org, aviadr@...lanox.com, nbd@...nwrt.org,
	alexei.starovoitov@...il.com, Neil.Jerram@...aswitch.com,
	ronye@...lanox.com, simon.horman@...ronome.com,
	alexander.h.duyck@...hat.com, john.ronciak@...el.com,
	mleitner@...hat.com, shrijeet@...il.com, bcrl@...ck.org
Subject: Re: [patch net-next v3 02/17] net: make vid as a parameter for
 ndo_fdb_add/ndo_fdb_del

On Tue, Nov 25, 2014 at 11:28:33AM +0100, Jiri Pirko wrote:
> Do the work of parsing NDA_VLAN directly in rtnetlink code, pass simple
> u16 vid to drivers from there.
> 
> Signed-off-by: Jiri Pirko <jiri@...nulli.us>

Structurally this looks fine, just a misspelling noted below.

Acked-by: Andy Gospodarek <gospo@...ulusnetworks.com>

> ---
> new in v3
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c      |  2 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c    |  4 +-
>  drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |  9 +++--
>  drivers/net/macvlan.c                            |  4 +-
>  drivers/net/vxlan.c                              |  4 +-
>  include/linux/netdevice.h                        |  8 ++--
>  include/linux/rtnetlink.h                        |  6 ++-
>  net/bridge/br_fdb.c                              | 39 ++----------------
>  net/bridge/br_private.h                          |  4 +-
>  net/core/rtnetlink.c                             | 50 ++++++++++++++++++++----
>  10 files changed, 70 insertions(+), 60 deletions(-)
> 
[...]
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index a688268..f2a4b38 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -36,6 +36,7 @@
>  #include <linux/mutex.h>
>  #include <linux/if_addr.h>
>  #include <linux/if_bridge.h>
> +#include <linux/if_vlan.h>
>  #include <linux/pci.h>
>  #include <linux/etherdevice.h>
>  
> @@ -2312,7 +2313,7 @@ errout:
>  int ndo_dflt_fdb_add(struct ndmsg *ndm,
>  		     struct nlattr *tb[],
>  		     struct net_device *dev,
> -		     const unsigned char *addr,
> +		     const unsigned char *addr, u16 vid,
>  		     u16 flags)
>  {
>  	int err = -EINVAL;
> @@ -2338,6 +2339,28 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm,
>  }
>  EXPORT_SYMBOL(ndo_dflt_fdb_add);
>  
> +static int fbd_vid_parse(struct nlattr *vlan_attr, u16 *p_vid)
I presume this is a misspelling?

[...]
> @@ -2370,6 +2394,10 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh)
>  
>  	addr = nla_data(tb[NDA_LLADDR]);
>  
> +	err = fbd_vid_parse(tb[NDA_VLAN], &vid);
Same here....

> +	if (err)
> +		return err;
> +
>  	err = -EOPNOTSUPP;
>  
>  	/* Support fdb on master device the net/bridge default case */

[...]
> @@ -2465,6 +2496,10 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
>  
>  	addr = nla_data(tb[NDA_LLADDR]);
>  
> +	err = fbd_vid_parse(tb[NDA_VLAN], &vid);
...and here.

> +	if (err)
> +		return err;
> +
>  	err = -EOPNOTSUPP;
>  
>  	/* Support fdb on master device the net/bridge default case */
> @@ -2474,7 +2509,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
>  		const struct net_device_ops *ops = br_dev->netdev_ops;
>  
>  		if (ops->ndo_fdb_del)
> -			err = ops->ndo_fdb_del(ndm, tb, dev, addr);
> +			err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid);
>  
>  		if (err)
>  			goto out;
> @@ -2485,9 +2520,10 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh)
>  	/* Embedded bridge, macvlan, and any other device support */
>  	if (ndm->ndm_flags & NTF_SELF) {
>  		if (dev->netdev_ops->ndo_fdb_del)
> -			err = dev->netdev_ops->ndo_fdb_del(ndm, tb, dev, addr);
> +			err = dev->netdev_ops->ndo_fdb_del(ndm, tb, dev, addr,
> +							   vid);
>  		else
> -			err = ndo_dflt_fdb_del(ndm, tb, dev, addr);
> +			err = ndo_dflt_fdb_del(ndm, tb, dev, addr, vid);
>  
>  		if (!err) {
>  			rtnl_fdb_notify(dev, addr, RTM_DELNEIGH);
> -- 
> 1.9.3
> 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ