Skip to contentSkip to conversation

ipv6: Check return of dev_set_allmulti

PATCH In review Wang Chen 3 participants 5 messages Jun 20, 2008 – Jun 24, 2008

Subsystems (3)
lore
Share & tools
lore

Wang Chen

author
#0 lore raw

PATCH 5/8 ipv6: Check return of dev_set_allmulti

allmulti might overflow.
Commit: "netdevice: Fix promiscuity and allmulti overflow" in net-next makes dev_set_promiscuity/allmulti return error number if overflow happened.

Here, we check the positive increment for allmulti to get error return.

---
 net/ipv6/ip6mr.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
net/ipv6/ip6mr.c +5 -1
index 1479618..7a97566 100644
@@ -603,6 +603,7 @@ static int mif6_add(struct mif6ctl *vifc, int mrtsock)
 	int vifi = vifc->mif6c_mifi;
 	struct mif_device *v = &vif6_table[vifi];
 	struct net_device *dev;
+	int err;
 
 	/* Is vif busy ? */
 	if (MIF_EXISTS(vifi))
@@ -632,7 +633,10 @@ static int mif6_add(struct mif6ctl *vifc, int mrtsock)
 		return -EINVAL;
 	}
 
-	dev_set_allmulti(dev, 1);
+	/* Check whether allmulti overflow */
+	err = dev_set_allmulti(dev, 1);
+	if (err)
+		return err;
 
 	/*
 	 *	Fill in the VIF structures
Signature · 1 line
1.5.3.4
maintainer
#1 lore raw

From: Wang Chen <[email protected]>
Date: Fri, 20 Jun 2008 08:55:23 +0800

net/ipv6/ip6mr.c static int mif6_add(struct mif6ctl *vifc, int mrtsock) · line 639

Quoted 9 lines
net/ipv6/ip6mr.c +4 -1
@@ -632,7 +633,10 @@ static int mif6_add(struct mif6ctl *vifc, int mrtsock)
 		return -EINVAL;
 	}
 
-	dev_set_allmulti(dev, 1);
+	/* Check whether allmulti overflow */
+	err = dev_set_allmulti(dev, 1);
+	if (err)
+		return err;

Please delete comment.

author
#2 lore raw

David Miller said the following on 2008-6-20 10:09:

Quoted 1 line

Please delete comment.

allmulti might overflow.
Commit: "netdevice: Fix promiscuity and allmulti overflow" in net-next makes dev_set_promiscuity/allmulti return error number if overflow happened.

Here, we check the positive increment for allmulti to get error return.

---
 net/ipv6/ip6mr.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
net/ipv6/ip6mr.c +4 -1
index 1479618..3e2d964 100644
@@ -603,6 +603,7 @@ static int mif6_add(struct mif6ctl *vifc, int mrtsock)
 	int vifi = vifc->mif6c_mifi;
 	struct mif_device *v = &vif6_table[vifi];
 	struct net_device *dev;
+	int err;
 
 	/* Is vif busy ? */
 	if (MIF_EXISTS(vifi))
@@ -632,7 +633,9 @@ static int mif6_add(struct mif6ctl *vifc, int mrtsock)
 		return -EINVAL;
 	}
 
-	dev_set_allmulti(dev, 1);
+	err = dev_set_allmulti(dev, 1);
+	if (err)
+		return err;
 
 	/*
 	 *	Fill in the VIF structures
Signature · 1 line
1.5.3.4
#3 lore raw
In reply to Wang Chen

In article <[email protected]> (at Fri, 20 Jun 2008 08:55:23 +0800), Wang Chen <[email protected]> says:

Quoted 7 lines

allmulti might overflow.
Commit: "netdevice: Fix promiscuity and allmulti overflow" in net-next makes dev_set_promiscuity/allmulti return error number if overflow happened.

Here, we check the positive increment for allmulti to get error return.

The comment is too obvious to have.

--yoshfuji

author
#4 lore raw

YOSHIFUJI Hideaki / 吉藤英明 said the following on 2008-6-24 11:52:

Quoted 6 lines

In article <[email protected]> (at Fri, 20 Jun 2008 08:55:23 +0800), Wang Chen <[email protected]> says:

Quoted 4 lines

allmulti might overflow.
Commit: "netdevice: Fix promiscuity and allmulti overflow" in net-next makes dev_set_promiscuity/allmulti return error number if overflow happened.

Quoted 6 lines
Quoted 3 lines

Here, we check the positive increment for allmulti to get error return.

The comment is too obvious to have.

It's just explain the background of this series of fix.