diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 08:39:20 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 08:39:20 -0800 |
commit | b55813a2e50088ca30df33fa62aeed5d3adb1796 (patch) | |
tree | be50fe404e94869fe854766e190a5753dbc7dd49 /net/core | |
parent | 368d17e068f691dba5a4f122c271db5ec9b2ebd6 (diff) | |
parent | 9e19bb6d7a0959f5028d46e1ab99c50f0d36eda8 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[NETFILTER] x_table.c: sem2mutex
[IPV4]: Aggregate route entries with different TOS values
[TCP]: Mark tcp_*mem[] __read_mostly.
[TCP]: Set default max buffers from memory pool size
[SCTP]: Fix up sctp_rcv return value
[NET]: Take RTNL when unregistering notifier
[WIRELESS]: Fix config dependencies.
[NET]: Fill in a 32-bit hole in struct sock on 64-bit platforms.
[NET]: Ensure device name passed to SO_BINDTODEVICE is NULL terminated.
[MODULES]: Don't allow statically declared exports
[BRIDGE]: Unaligned accesses in the ethernet bridge
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 7 | ||||
-rw-r--r-- | net/core/sock.c | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 08dec6eb922b..e0489ca731c5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -977,7 +977,12 @@ int register_netdevice_notifier(struct notifier_block *nb) int unregister_netdevice_notifier(struct notifier_block *nb) { - return notifier_chain_unregister(&netdev_chain, nb); + int err; + + rtnl_lock(); + err = notifier_chain_unregister(&netdev_chain, nb); + rtnl_unlock(); + return err; } /** diff --git a/net/core/sock.c b/net/core/sock.c index 1a7e6eac90b0..e110b9004147 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -404,8 +404,9 @@ set_rcvbuf: if (!valbool) { sk->sk_bound_dev_if = 0; } else { - if (optlen > IFNAMSIZ) - optlen = IFNAMSIZ; + if (optlen > IFNAMSIZ - 1) + optlen = IFNAMSIZ - 1; + memset(devname, 0, sizeof(devname)); if (copy_from_user(devname, optval, optlen)) { ret = -EFAULT; break; |