linux/net/core
Wang Chen dad9b335c6 netdevice: Fix promiscuity and allmulti overflow
Max of promiscuity and allmulti plus positive @inc can cause overflow.
Fox example: when allmulti=0xFFFFFFFF, any caller give dev_set_allmulti() a
positive @inc will cause allmulti be off.
This is not what we want, though it's rare case.
The fix is that only negative @inc will cause allmulti or promiscuity be off
and when any caller makes the counters touch the roof, we return error.

Change of v2:
Change void function dev_set_promiscuity/allmulti to return int.
So callers can get the overflow error.
Caller's fix will be done later.

Change of v3:
1. Since we return error to caller, we don't need to print KERN_ERROR,
KERN_WARNING is enough.
2. In dev_set_promiscuity(), if __dev_set_promiscuity() failed, we
return at once.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-18 01:48:28 -07:00
..
datagram.c [NET] CORE: Introducing new memory accounting interface. 2008-01-28 15:00:18 -08:00
dev_mcast.c [NET]: Use existing device list walker for /proc/dev_mcast. 2008-02-29 11:44:14 -08:00
dev.c netdevice: Fix promiscuity and allmulti overflow 2008-06-18 01:48:28 -07:00
dst.c [NET]: uninline dst_release 2008-03-27 17:53:31 -07:00
ethtool.c ethtool: EEPROM dump no longer works for tg3 and natsemi 2008-04-24 20:55:56 -07:00
fib_rules.c [NETNS]: Add netns refcnt debug to fib rules. 2008-04-16 02:01:56 -07:00
filter.c net: use get/put_unaligned_* helpers 2008-05-02 16:26:16 -07:00
flow.c net: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:15:50 -04:00
gen_estimator.c [NET_SCHED]: Convert packet schedulers from rtnetlink to new netlink API 2008-01-28 15:11:10 -08:00
gen_stats.c [NET_SCHED]: Convert packet schedulers from rtnetlink to new netlink API 2008-01-28 15:11:10 -08:00
iovec.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
kmap_skb.h [PATCH] severing skbuff.h -> highmem.h 2006-12-04 02:00:29 -05:00
link_watch.c [NET] link_watch: Always schedule urgent events 2007-05-10 23:45:28 -07:00
Makefile [NET]: Fix running without sysfs 2007-10-10 16:52:46 -07:00
neighbour.c netlink: Improve returned error codes 2008-06-03 16:36:54 -07:00
net_namespace.c [NETNS]: Make netns refconting debug like a socket one. 2008-04-16 01:58:04 -07:00
net-sysfs.c bonding: Allow setting max_bonds to zero 2008-06-18 00:00:04 -04:00
net-sysfs.h netns: Fix device renaming for sysfs 2008-05-02 17:00:58 -07:00
netevent.c [NET]: net/core/netevent.c should #include <net/netevent.h> 2007-07-05 17:40:27 -07:00
netpoll.c net: Allow netdevices to specify needed head/tailroom 2008-05-12 20:48:31 -07:00
pktgen.c pktgen: make sure that pktgen_thread_worker has been executed 2008-05-20 15:12:44 -07:00
request_sock.c [NET] net/core/request_sock.c: Remove unused exports. 2008-01-28 14:54:33 -08:00
rtnetlink.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-06-10 02:22:26 -07:00
scm.c [NET]: Fix function put_cmsg() which may cause usr application memory overflow 2007-12-20 14:36:44 -08:00
skbuff.c net: remove CVS keywords 2008-06-11 21:00:38 -07:00
sock.c net: Add sk_set_socket() helper. 2008-06-17 22:41:38 -07:00
stream.c [NET] CORE: Introducing new memory accounting interface. 2008-01-28 15:00:18 -08:00
sysctl_net_core.c netns: Register net/core/ sysctls at read-only root. 2008-05-19 13:49:52 -07:00
user_dma.c net_dma: remove duplicate assignment in dma_skb_copy_datagram_iovec 2008-06-03 16:07:45 -07:00
utils.c [NET] core/utils.c: digit2bin is dead static inline 2008-01-28 15:01:58 -08:00