Netdev List
 help / color / mirror / Atom feed
* [net-2.6 PATCH 1/3] net: fix vlan_get_size to include vlan_flags size
@ 2009-09-25 23:11 Jeff Kirsher
  2009-09-25 23:11 ` [net-2.6 PATCH 2/3] net: fix nlmsg len size for skb when error bit is set Jeff Kirsher
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jeff Kirsher @ 2009-09-25 23:11 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, John Fastabend, Jeff Kirsher

From: John Fastabend <john.r.fastabend@intel.com>

Fix vlan_get_size to include vlan->flags.  Currently, the
size of the vlan flags is not included in the nlmsg size.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 net/8021q/vlan_netlink.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
index 343146e..a915048 100644
--- a/net/8021q/vlan_netlink.c
+++ b/net/8021q/vlan_netlink.c
@@ -169,6 +169,7 @@ static size_t vlan_get_size(const struct net_device *dev)
 	struct vlan_dev_info *vlan = vlan_dev_info(dev);
 
 	return nla_total_size(2) +	/* IFLA_VLAN_ID */
+	       sizeof(struct ifla_vlan_flags) + /* IFLA_VLAN_FLAGS */
 	       vlan_qos_map_size(vlan->nr_ingress_mappings) +
 	       vlan_qos_map_size(vlan->nr_egress_mappings);
 }


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

* [net-2.6 PATCH 2/3] net: fix nlmsg len size for skb when error bit is set.
  2009-09-25 23:11 [net-2.6 PATCH 1/3] net: fix vlan_get_size to include vlan_flags size Jeff Kirsher
@ 2009-09-25 23:11 ` Jeff Kirsher
  2009-09-25 23:12 ` [net-2.6 PATCH 3/3] net: fix double skb free in dcbnl Jeff Kirsher
  2009-09-27  3:18 ` [net-2.6 PATCH 1/3] net: fix vlan_get_size to include vlan_flags size David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2009-09-25 23:11 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, John Fastabend, Jeff Kirsher

From: John Fastabend <john.r.fastabend@intel.com>

Currently, the nlmsg->len field is not set correctly in  netlink_ack()
for ack messages that include the nlmsg of the error frame.  This
corrects the length field passed to __nlmsg_put to use the correct
payload size.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 net/netlink/af_netlink.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index a4bafbf..dd85320 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1788,7 +1788,7 @@ void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
 	}
 
 	rep = __nlmsg_put(skb, NETLINK_CB(in_skb).pid, nlh->nlmsg_seq,
-			  NLMSG_ERROR, sizeof(struct nlmsgerr), 0);
+			  NLMSG_ERROR, payload, 0);
 	errmsg = nlmsg_data(rep);
 	errmsg->error = err;
 	memcpy(&errmsg->msg, nlh, err ? nlh->nlmsg_len : sizeof(*nlh));


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

* [net-2.6 PATCH 3/3] net: fix double skb free in dcbnl
  2009-09-25 23:11 [net-2.6 PATCH 1/3] net: fix vlan_get_size to include vlan_flags size Jeff Kirsher
  2009-09-25 23:11 ` [net-2.6 PATCH 2/3] net: fix nlmsg len size for skb when error bit is set Jeff Kirsher
@ 2009-09-25 23:12 ` Jeff Kirsher
  2009-09-27  3:18 ` [net-2.6 PATCH 1/3] net: fix vlan_get_size to include vlan_flags size David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2009-09-25 23:12 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, John Fastabend, Jeff Kirsher

From: John Fastabend <john.r.fastabend@intel.com>

netlink_unicast() calls kfree_skb even in the error case.

dcbnl calls netlink_unicast() which when it fails free's the
skb and returns an error value.  dcbnl is free'ing the skb
again when this error occurs.  This patch removes the double
free.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 net/dcb/dcbnl.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index e0879bf..ac1205d 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -194,7 +194,7 @@ static int dcbnl_reply(u8 value, u8 event, u8 cmd, u8 attr, u32 pid,
 	nlmsg_end(dcbnl_skb, nlh);
 	ret = rtnl_unicast(dcbnl_skb, &init_net, pid);
 	if (ret)
-		goto err;
+		return -EINVAL;
 
 	return 0;
 nlmsg_failure:
@@ -275,7 +275,7 @@ static int dcbnl_getpfccfg(struct net_device *netdev, struct nlattr **tb,
 
 	ret = rtnl_unicast(dcbnl_skb, &init_net, pid);
 	if (ret)
-		goto err;
+		goto err_out;
 
 	return 0;
 nlmsg_failure:
@@ -316,12 +316,11 @@ static int dcbnl_getperm_hwaddr(struct net_device *netdev, struct nlattr **tb,
 
 	ret = rtnl_unicast(dcbnl_skb, &init_net, pid);
 	if (ret)
-		goto err;
+		goto err_out;
 
 	return 0;
 
 nlmsg_failure:
-err:
 	kfree_skb(dcbnl_skb);
 err_out:
 	return -EINVAL;
@@ -383,7 +382,7 @@ static int dcbnl_getcap(struct net_device *netdev, struct nlattr **tb,
 
 	ret = rtnl_unicast(dcbnl_skb, &init_net, pid);
 	if (ret)
-		goto err;
+		goto err_out;
 
 	return 0;
 nlmsg_failure:
@@ -460,7 +459,7 @@ static int dcbnl_getnumtcs(struct net_device *netdev, struct nlattr **tb,
 	ret = rtnl_unicast(dcbnl_skb, &init_net, pid);
 	if (ret) {
 		ret = -EINVAL;
-		goto err;
+		goto err_out;
 	}
 
 	return 0;
@@ -799,7 +798,7 @@ static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlattr **tb,
 
 	ret = rtnl_unicast(dcbnl_skb, &init_net, pid);
 	if (ret)
-		goto err;
+		goto err_out;
 
 	return 0;
 
@@ -1063,7 +1062,7 @@ static int dcbnl_bcn_getcfg(struct net_device *netdev, struct nlattr **tb,
 
 	ret = rtnl_unicast(dcbnl_skb, &init_net, pid);
 	if (ret)
-		goto err;
+		goto err_out;
 
 	return 0;
 


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

* Re: [net-2.6 PATCH 1/3] net: fix vlan_get_size to include vlan_flags size
  2009-09-25 23:11 [net-2.6 PATCH 1/3] net: fix vlan_get_size to include vlan_flags size Jeff Kirsher
  2009-09-25 23:11 ` [net-2.6 PATCH 2/3] net: fix nlmsg len size for skb when error bit is set Jeff Kirsher
  2009-09-25 23:12 ` [net-2.6 PATCH 3/3] net: fix double skb free in dcbnl Jeff Kirsher
@ 2009-09-27  3:18 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2009-09-27  3:18 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, john.r.fastabend


All 3 patches applied, thanks!

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

end of thread, other threads:[~2009-09-27  3:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25 23:11 [net-2.6 PATCH 1/3] net: fix vlan_get_size to include vlan_flags size Jeff Kirsher
2009-09-25 23:11 ` [net-2.6 PATCH 2/3] net: fix nlmsg len size for skb when error bit is set Jeff Kirsher
2009-09-25 23:12 ` [net-2.6 PATCH 3/3] net: fix double skb free in dcbnl Jeff Kirsher
2009-09-27  3:18 ` [net-2.6 PATCH 1/3] net: fix vlan_get_size to include vlan_flags size David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox