netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 5/8] ipv6: Check return of dev_set_allmulti
@ 2008-06-20  0:55 Wang Chen
  2008-06-20  2:09 ` David Miller
  2008-06-24  3:52 ` YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 2 replies; 5+ messages in thread
From: Wang Chen @ 2008-06-20  0:55 UTC (permalink / raw)
  To: David S. Miller; +Cc: YOSHIFUJI Hideaki, NETDEV, Patrick McHardy

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.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
 net/ipv6/ip6mr.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 1479618..7a97566 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -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
-- 
1.5.3.4




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

end of thread, other threads:[~2008-06-24  5:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-20  0:55 [PATCH net-next 5/8] ipv6: Check return of dev_set_allmulti Wang Chen
2008-06-20  2:09 ` David Miller
2008-06-20  3:06   ` Wang Chen
2008-06-24  3:52 ` YOSHIFUJI Hideaki / 吉藤英明
2008-06-24  5:01   ` Wang Chen

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).