aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2008-02-23[RTNL]: Validate hardware and broadcast address attribute for RTM_NEWLINKThomas Graf1-6/+19
RTM_NEWLINK allows for already existing links to be modified. For this purpose do_setlink() is called which expects address attributes with a payload length of at least dev->addr_len. This patch adds the necessary validation for the RTM_NEWLINK case. The address length for links to be created is not checked for now as the actual attribute length is used when copying the address to the netdevice structure. It might make sense to report an error if less than addr_len bytes are provided but enforcing this might break drivers trying to be smart with not transmitting all zero addresses. Signed-off-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-23PM: Introduce PM_EVENT_HIBERNATE callback stateRafael J. Wysocki1-1/+1
During the last step of hibernation in the "platform" mode (with the help of ACPI) we use the suspend code, including the devices' ->suspend() methods, to prepare the system for entering the ACPI S4 system sleep state. But at least for some devices the operations performed by the ->suspend() callback in that case must be different from its operations during regular suspend. For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and pass it to the device drivers' ->suspend() methods during the last phase of hibernation, so that they can distinguish this case and handle it as appropriate. Modify the drivers that handle PM_EVENT_SUSPEND in a special way and need to handle PM_EVENT_HIBERNATE in the same way. These changes are necessary to fix a hibernation regression related to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488). Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Pavel Machek <[email protected]> Tested-by: Jeff Chua <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-21Wrap buffers used for rpc debug printks into RPC_IFDEBUGPavel Emelyanov1-3/+3
Sorry for the noise, but here's the v3 of this compilation fix :) There are some places, which declare the char buf[...] on the stack to push it later into dprintk(). Since the dprintk sometimes (if the CONFIG_SYSCTL=n) becomes an empty do { } while (0) stub, these buffers cause gcc to produce appropriate warnings. Wrap these buffers with RPC_IFDEBUG macro, as Trond proposed, to compile them out when not needed. Signed-off-by: Pavel Emelyanov <[email protected]> Acked-by: J. Bruce Fields <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2008-02-20[NETNS]: Namespace leak in pneigh_lookup.Denis V. Lunev1-0/+1
release_net is missed on the error path in pneigh_lookup. Signed-off-by: Denis V. Lunev <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-20[SCTP]: Pick up an orphaned sctp_sockets_allocated counter.Pavel Emelyanov1-0/+2
This counter is currently write-only. Drawing an analogy with the similar tcp counter, I think that this one should be pointed by the sockets_allocated members of sctp_prot and sctpv6_prot. Signed-off-by: Pavel Emelyanov <[email protected]> Acked-by: Vlad Yasevich <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-19[NETFILTER]: xt_iprange: fix subtraction-based comparisonJan Engelhardt1-1/+1
The host address parts need to be converted to host-endian first before arithmetic makes any sense on them. Signed-off-by: Jan Engelhardt <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-19[NETFILTER]: xt_hashlimit: remove unneeded struct memberJan Engelhardt1-3/+0
By allocating ->hinfo, we already have the needed indirection to cope with the per-cpu xtables struct match_entry. [Patrick: do this now before the revision 1 struct is used by userspace] Signed-off-by: Jan Engelhardt <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-19[NETFILTER]: Fix incorrect use of skb_make_writableJoonwoo Park4-4/+4
http://bugzilla.kernel.org/show_bug.cgi?id=9920 The function skb_make_writable returns true or false. Signed-off-by: Joonwoo Park <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-19[NETFILTER]: xt_u32: drop the actually unused variable from u32_match_itPavel Emelyanov1-6/+5
The int ret variable is used only to trigger the BUG_ON() after the skb_copy_bits() call, so check the call failure directly and drop the variable. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-19[NETFILTER]: {ip,ip6,nfnetlink}_queue: fix SKB_LINEAR_ASSERT when mangling ↵Patrick McHardy3-13/+19
packet data As reported by Tomas Simonaitis <[email protected]>, inserting new data in skbs queued over {ip,ip6,nfnetlink}_queue triggers a SKB_LINEAR_ASSERT in skb_put(). Going back through the git history, it seems this bug is present since at least 2.6.12-rc2, probably even since the removal of skb_linearize() for netfilter. Linearize non-linear skbs through skb_copy_expand() when enlarging them. Tested by Thomas, fixes bugzilla #9933. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-19ipv4/fib_hash.c: fix NULL dereferenceAdrian Bunk1-5/+5
Unless I miss a guaranteed relation between between "f" and "new_fa->fa_info" this patch is required for fixing a NULL dereference introduced by commit a6501e080c318f8d4467679d17807f42b3a33cd5 ("[IPV4] FIB_HASH: Reduce memory needs and speedup lookups") and spotted by the Coverity checker. Eric Dumazet says: Hum, you are right, kmem_cache_free() doesnt allow a NULL object, like kfree() does. Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-19net/9p/trans_virtio.c: kmalloc() enough memoryAdrian Bunk1-1/+1
The Coverity checker spotted that less memory than required was allocated. Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-19[RTNL]: Add missing link netlink attribute policy definitionsThomas Graf1-0/+2
IFLA_LINK is no longer a write-only attribute on the kernel side and must thus be validated. Same goes for the newly introduced IFLA_LINKINFO. Fixes undefined behaviour if either of the attributes are not well formed. Signed-off-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-19[NET]: Messed multicast lists after dev_mc_sync/unsyncJorge Boncompte [DTI2]1-1/+1
Commit a0a400d79e3dd7843e7e81baa3ef2957bdc292d0 ("[NET]: dev_mcast: add multicast list synchronization helpers") from you introduced a new field "da_synced" to struct dev_addr_list that is not properly initialized to 0. So when any of the current users (8021q, macvlan, mac80211) calls dev_mc_sync/unsync they mess the address list for both devices. The attached patch fixed it for me and avoid future problems. Signed-off-by: Jorge Boncompte [DTI2] <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-19Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds23-220/+155
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (60 commits) [NIU]: Bump driver version and release date. [NIU]: Fix BMAC alternate MAC address indexing. net: fix kernel-doc warnings in header files [IPV6]: Use BUG_ON instead of if + BUG in fib6_del_route. [IPV6]: dst_entry leak in ip4ip6_err. (resend) bluetooth: do not move child device other than rfcomm bluetooth: put hci dev after del conn [NET]: Elminate spurious print_mac() calls. [BLUETOOTH] hci_sysfs.c: Kill build warning. [NET]: Remove MAC_FMT net/8021q/vlan_dev.c: Use print_mac. [XFRM]: Fix ordering issue in xfrm_dst_hash_transfer(). [BLUETOOTH] net/bluetooth/hci_core.c: Use time_* macros [IPV6]: Fix hardcoded removing of old module code [NETLABEL]: Move some initialization code into __init section. [NETLABEL]: Shrink the genl-ops registration code. [AX25] ax25_out: check skb for NULL in ax25_kick() [TCP]: Fix tcp_v4_send_synack() comment [IPV4]: fix alignment of IP-Config output Documentation: fix tcp.txt ...
2008-02-18[IPV6]: Use BUG_ON instead of if + BUG in fib6_del_route.Pavel Emelyanov1-1/+1
Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-18[IPV6]: dst_entry leak in ip4ip6_err. (resend)Denis V. Lunev1-0/+1
The result of the ip_route_output is not assigned to skb. This means that - it is leaked - possible OOPS below dereferrencing skb->dst - no ICMP message for this case Signed-off-by: Denis V. Lunev <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-18bluetooth: do not move child device other than rfcommDave Young1-7/+6
hci conn child devices other than rfcomm tty should not be moved here. This is my lost, thanks for Barnaby's reporting and testing. Signed-off-by: Dave Young <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-18bluetooth: put hci dev after del connDave Young2-1/+3
Move hci_dev_put to del_conn to avoid hci dev going away before hci conn. Signed-off-by: Dave Young <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-18[BLUETOOTH] hci_sysfs.c: Kill build warning.David S. Miller1-2/+6
net/bluetooth/hci_sysfs.c: In function ‘del_conn’: net/bluetooth/hci_sysfs.c:339: warning: suggest parentheses around assignment used as truth value Signed-off-by: David S. Miller <[email protected]>
2008-02-17net/8021q/vlan_dev.c: Use print_mac.Joe Perches1-6/+4
Remove direct use of MAC_FMT Signed-off-by: Joe Perches <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17[XFRM]: Fix ordering issue in xfrm_dst_hash_transfer().YOSHIFUJI Hideaki1-2/+18
Keep ordering of policy entries with same selector in xfrm_dst_hash_transfer(). Issue should not appear in usual cases because multiple policy entries with same selector are basically not allowed so far. Bug was pointed out by Sebastien Decugis <[email protected]>. We could convert bydst from hlist to list and use list_add_tail() instead. Signed-off-by: YOSHIFUJI Hideaki <[email protected]> Acked-by: Sebastien Decugis <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17[BLUETOOTH] net/bluetooth/hci_core.c: Use time_* macrosS.Çağlar Onur1-2/+3
The functions time_before, time_before_eq, time_after, and time_after_eq are more robust for comparing jiffies against other values. So following patch implements usage of the time_after() macro, defined at linux/jiffies.h, which deals with wrapping correctly Signed-off-by: S.Çağlar Onur <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17[IPV6]: Fix hardcoded removing of old module codeWang Chen1-8/+0
Rusty hardcoded the old module code. We can remove it now. Signed-off-by: Wang Chen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17[NETLABEL]: Move some initialization code into __init section.Pavel Emelyanov5-7/+7
Everything that is called from netlbl_init() can be marked with __init. This moves 620 bytes from .text section to .text.init one. Signed-off-by: Pavel Emelyanov <[email protected]> Acked-by: Paul Moore <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17[NETLABEL]: Shrink the genl-ops registration code.Pavel Emelyanov3-144/+64
Turning them to array and registration in a loop saves 80 lines of code and ~300 bytes from text section. Signed-off-by: Pavel Emelyanov <[email protected]> Acked-by: Paul Moore <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17[AX25] ax25_out: check skb for NULL in ax25_kick()Jarek Poplawski1-2/+11
According to some OOPS reports ax25_kick tries to clone NULL skbs sometimes. It looks like a race with ax25_clear_queues(). Probably there is no need to add more than a simple check for this yet. Another report suggested there are probably also cases where ax25 ->paclen == 0 can happen in ax25_output(); this wasn't confirmed during testing but let's leave this debugging check for some time. Reported-and-tested-by: Jann Traschewski <[email protected]> Signed-off-by: Jarek Poplawski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17[TCP]: Fix tcp_v4_send_synack() commentKris Katterjohn1-1/+1
Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17[IPV4]: fix alignment of IP-Config outputUwe Kleine-Koenig1-1/+1
Make the indented lines aligned in the output (not in the code). Signed-off-by: Uwe Kleine-Koenig <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17net/9p/trans_virtio.c: Use BUG_ONJulia Lawall1-2/+1
if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @ disable unlikely @ expression E,f; @@ ( if (<... f(...) ...>) { BUG(); } | - if (unlikely(E)) { BUG(); } + BUG_ON(E); ) @@ expression E,f; @@ ( if (<... f(...) ...>) { BUG(); } | - if (E) { BUG(); } + BUG_ON(E); ) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17net/rxrpc: Use BUG_ONJulia Lawall2-4/+2
if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @ disable unlikely @ expression E,f; @@ ( if (<... f(...) ...>) { BUG(); } | - if (unlikely(E)) { BUG(); } + BUG_ON(E); ) @@ expression E,f; @@ ( if (<... f(...) ...>) { BUG(); } | - if (E) { BUG(); } + BUG_ON(E); ) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-17Revert "[NDISC]: Fix race in generic address resolution"David S. Miller2-3/+12
This reverts commit 69cc64d8d92bf852f933e90c888dfff083bd4fc9. It causes recursive locking in IPV6 because unlike other neighbour layer clients, it even needs neighbour cache entries to send neighbour soliciation messages :-( We'll have to find another way to fix this race. Signed-off-by: David S. Miller <[email protected]>
2008-02-17Revert "[RTNETLINK]: Send a single notification on device state changes."David S. Miller1-26/+10
This reverts commit 45b503548210fe6f23e92b856421c2a3f05fd034. It break locking around dev->link_mode as well as cause other bootup problems. Signed-off-by: David S. Miller <[email protected]>
2008-02-15Merge branch 'fixes' of ↵David S. Miller1-1/+4
master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6
2008-02-15mac80211: Fix initial hardware configurationMichael Buesch1-1/+4
On the initial device-open we need to defer the hardware reconfiguration after we incremented the open_count, because the hw_config checks this flag and won't call the lowlevel driver in case it is zero. Signed-off-by: Michael Buesch <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-02-15Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds31-153/+210
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (82 commits) [NET]: Make sure sockets implement splice_read netconsole: avoid null pointer dereference at show_local_mac() [IPV6]: Fix reversed local_df test in ip6_fragment [XFRM]: Avoid bogus BUG() when throwing new policy away. [AF_KEY]: Fix bug in spdadd [NETFILTER] nf_conntrack_proto_tcp.c: Mistyped state corrected. net: xfrm statistics depend on INET [NETFILTER]: make secmark_tg_destroy() static [INET]: Unexport inet_listen_wlock [INET]: Unexport __inet_hash_connect [NET]: Improve cache line coherency of ingress qdisc [NET]: Fix race in dev_close(). (Bug 9750) [IPSEC]: Fix bogus usage of u64 on input sequence number [RTNETLINK]: Send a single notification on device state changes. [NETLABLE]: Hide netlbl_unlabel_audit_addr6 under ifdef CONFIG_IPV6. [NETLABEL]: Don't produce unused variables when IPv6 is off. [NETLABEL]: Compilation for CONFIG_AUDIT=n case. [GENETLINK]: Relax dances with genl_lock. [NETLABEL]: Fix lookup logic of netlbl_domhsh_search_def. [IPV6]: remove unused method declaration (net/ndisc.h). ...
2008-02-15[NET]: Make sure sockets implement splice_readRémi Denis-Courmont1-0/+3
Fixes a segmentation fault when trying to splice from a non-TCP socket. Signed-off-by: Rémi Denis-Courmont <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-14[IPV6]: Fix reversed local_df test in ip6_fragmentHerbert Xu1-2/+2
I managed to reverse the local_df test when forward-porting this patch so it actually makes things worse by never fragmenting at all. Thanks to David Stevens for testing and reporting this bug. Bill Fink pointed out that the local_df setting is also the wrong way around. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-14Introduce path_put()Jan Blunck2-4/+4
* Add path_put() functions for releasing a reference to the dentry and vfsmount of a struct path in the right order * Switch from path_release(nd) to path_put(&nd->path) * Rename dput_path() to path_put_conditional() [[email protected]: fix cifs] Signed-off-by: Jan Blunck <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Cc: <[email protected]> Cc: Al Viro <[email protected]> Cc: Steven French <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-14Embed a struct path into struct nameidata instead of nd->{dentry,mnt}Jan Blunck2-12/+13
This is the central patch of a cleanup series. In most cases there is no good reason why someone would want to use a dentry for itself. This series reflects that fact and embeds a struct path into nameidata. Together with the other patches of this series - it enforced the correct order of getting/releasing the reference count on <dentry,vfsmount> pairs - it prepares the VFS for stacking support since it is essential to have a struct path in every place where the stack can be traversed - it reduces the overall code size: without patch series: text data bss dec hex filename 5321639 858418 715768 6895825 6938d1 vmlinux with patch series: text data bss dec hex filename 5320026 858418 715768 6894212 693284 vmlinux This patch: Switch from nd->{dentry,mnt} to nd->path.{dentry,mnt} everywhere. [[email protected]: coding-style fixes] [[email protected]: fix cifs] [[email protected]: fix smack] Signed-off-by: Jan Blunck <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Cc: Al Viro <[email protected]> Cc: Casey Schaufler <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-14[XFRM]: Avoid bogus BUG() when throwing new policy away.YOSHIFUJI Hideaki1-0/+1
From: YOSHIFUJI Hideaki <[email protected]> When we destory a new policy entry, we need to tell xfrm_policy_destroy() explicitly that the entry is not alive yet. Signed-off-by: David S. Miller <[email protected]>
2008-02-14[AF_KEY]: Fix bug in spdaddKazunori MIYAZAWA1-0/+1
This patch fix a BUG when adding spds which have same selector. Signed-off-by: Kazunori MIYAZAWA <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-14[NETFILTER] nf_conntrack_proto_tcp.c: Mistyped state corrected.Jozsef Kadlecsik1-1/+1
Signed-off-by: Jozsef Kadlecsik <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-14net: xfrm statistics depend on INETPaul Mundt1-1/+1
net/built-in.o: In function `xfrm_policy_init': /home/pmundt/devel/git/sh-2.6.25/net/xfrm/xfrm_policy.c:2338: undefined reference to `snmp_mib_init' snmp_mib_init() is only built in if CONFIG_INET is set. Signed-off-by: Paul Mundt <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-13[NETFILTER]: make secmark_tg_destroy() staticAdrian Bunk1-1/+1
This patch makes the needlessly global secmark_tg_destroy() static. Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-13[INET]: Unexport inet_listen_wlockAdrian Bunk1-2/+0
This patch removes the no longer used EXPORT_SYMBOL(inet_listen_wlock). Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-13[INET]: Unexport __inet_hash_connectAdrian Bunk1-1/+0
This patch removes the unused EXPORT_SYMBOL_GPL(__inet_hash_connect). Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-02-13docbook: make a networking book and fix a few errorsRandy Dunlap2-4/+3
Move networking (core and drivers) docbook to its own networking book. Fix a few kernel-doc errors in header and source files. Signed-off-by: Randy Dunlap <[email protected]> Cc: Trond Myklebust <[email protected]> Cc: "J. Bruce Fields" <[email protected]> Cc: Neil Brown <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-13docbook: sunrpc filenames and notation fixesRandy Dunlap3-7/+8
Use updated file list for docbook files and fix kernel-doc warnings in sunrpc: Warning(linux-2.6.24-git12//net/sunrpc/rpc_pipe.c:689): No description found for parameter 'rpc_client' Warning(linux-2.6.24-git12//net/sunrpc/rpc_pipe.c:765): No description found for parameter 'flags' Warning(linux-2.6.24-git12//net/sunrpc/clnt.c:584): No description found for parameter 'tk_ops' Warning(linux-2.6.24-git12//net/sunrpc/clnt.c:618): No description found for parameter 'bufsize' Signed-off-by: Randy Dunlap <[email protected]> Cc: Trond Myklebust <[email protected]> Cc: "J. Bruce Fields" <[email protected]> Cc: Neil Brown <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-13remove final fastcall usersHarvey Harrison3-5/+5
fastcall always expands to empty, remove it. Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>