All of lore.kernel.org
 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

* Re: [PATCH net-next 5/8] ipv6: Check return of dev_set_allmulti
  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 / 吉藤英明
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2008-06-20  2:09 UTC (permalink / raw)
  To: wangchen; +Cc: yoshfuji, netdev, kaber

From: Wang Chen <wangchen@cn.fujitsu.com>
Date: Fri, 20 Jun 2008 08:55:23 +0800

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

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

* Re: [PATCH net-next 5/8] ipv6: Check return of dev_set_allmulti
  2008-06-20  2:09 ` David Miller
@ 2008-06-20  3:06   ` Wang Chen
  0 siblings, 0 replies; 5+ messages in thread
From: Wang Chen @ 2008-06-20  3:06 UTC (permalink / raw)
  To: David Miller; +Cc: yoshfuji, netdev, kaber

David Miller said the following on 2008-6-20 10:09:
> 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.

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

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 1479618..3e2d964 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,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
-- 
1.5.3.4


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

* Re: [PATCH net-next 5/8] ipv6: Check return of dev_set_allmulti
  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-24  3:52 ` YOSHIFUJI Hideaki / 吉藤英明
  2008-06-24  5:01   ` Wang Chen
  1 sibling, 1 reply; 5+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-06-24  3:52 UTC (permalink / raw)
  To: wangchen; +Cc: davem, netdev, kaber, yoshfuji

In article <485AFFFB.5040901@cn.fujitsu.com> (at Fri, 20 Jun 2008 08:55:23 +0800), Wang Chen <wangchen@cn.fujitsu.com> says:

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

The comment is too obvious to have.

--yoshfuji

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

* Re: [PATCH net-next 5/8] ipv6: Check return of dev_set_allmulti
  2008-06-24  3:52 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2008-06-24  5:01   ` Wang Chen
  0 siblings, 0 replies; 5+ messages in thread
From: Wang Chen @ 2008-06-24  5:01 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki / 吉藤英明; +Cc: davem, netdev, kaber

YOSHIFUJI Hideaki / 吉藤英明 said the following on 2008-6-24 11:52:
> In article <485AFFFB.5040901@cn.fujitsu.com> (at Fri, 20 Jun 2008 08:55:23 +0800), Wang Chen <wangchen@cn.fujitsu.com> says:
> 
>> 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>
> 
> The comment is too obvious to have.
> 

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


^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.