From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wang Chen Subject: Re: v2 [PATCH net-next 1/8] af_packet: Check return of dev_set_promiscuity/allmulti Date: Tue, 01 Jul 2008 17:42:42 +0800 Message-ID: <4869FC12.9030300@cn.fujitsu.com> References: <4869A251.108@cn.fujitsu.com> <4869A2D5.1010605@cn.fujitsu.com> <4869FA91.30405@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , NETDEV To: Patrick McHardy Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:57066 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752621AbYGAJrU (ORCPT ); Tue, 1 Jul 2008 05:47:20 -0400 In-Reply-To: <4869FA91.30405@trash.net> Sender: netdev-owner@vger.kernel.org List-ID: Patrick McHardy said the following on 2008-7-1 17:36: > Wang Chen wrote: >> dev_set_promiscuity/allmulti might overflow. >> Commit: "netdevice: Fix promiscuity and allmulti overflow" in net-next >> makes >> dev_set_promiscuity/allmulti return error number if overflow happened. >> >> In af_packet, we check all positive increment for promiscuity and >> allmulti >> to get error return. >> >> static void packet_dev_mclist(struct net_device *dev, struct >> packet_mclist *i, int what) >> @@ -1245,7 +1247,7 @@ static int packet_mc_add(struct sock *sk, struct >> packet_mreq_max *mreq) >> i->count = 1; >> i->next = po->mclist; >> po->mclist = i; >> - packet_dev_mc(dev, i, +1); >> + err = packet_dev_mc(dev, i, 1); > > Missing error handling. The packet_mclist is already initialized > and on the list here, which will result in deletion without > addition in packet_flush_mclist(). > will do.