aboutsummaryrefslogtreecommitdiff
path: root/net/core
AgeCommit message (Collapse)AuthorFilesLines
2006-02-27[REQSK]: Don't reset rskq_defer_accept in reqsk_queue_allocArnaldo Carvalho de Melo1-1/+0
In 295f7324ff8d9ea58b4d3ec93b1aaa1d80e048a9 I moved defer_accept from tcp_sock to request_queue and mistakingly reset it at reqsl_queue_alloc, causing calls to setsockopt(TCP_DEFER_ACCEPT ) to be lost after bind, the fix is to remove the zeroing of rskq_defer_accept from reqsl_queue_alloc. Thanks to Alexandra N. Kossovsky <[email protected]> for reporting and testing the suggested fix. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-02-19[NET]: NETFILTER: remove duplicated lines and fix order in skb_clone().YOSHIFUJI Hideaki1-7/+3
Some of netfilter-related members are initalized / copied twice in skb_clone(). Remove one. Pointed out by Olivier MATZ <[email protected]>. And this patch also fixes order of copying / clearing members. Signed-off-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-02-13[NET]: Revert skb_copy_datagram_iovec() recursion elimination.David S. Miller1-28/+53
Revert the following changeset: bc8dfcb93970ad7139c976356bfc99d7e251deaf Recursive SKB frag lists are really possible and disallowing them breaks things. Noticed by: Jesse Brandeburg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-02-09[NETLINK]: illegal use of pid in rtnetlinkAlexey Kuznetsov1-1/+1
When a netlink message is not related to a netlink socket, it is issued by kernel socket with pid 0. Netlink "pid" has nothing to do with current->pid. I called it incorrectly, if it was named "port", the confusion would be avoided. Signed-off-by: Alexey Kuznetsov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-02-05[PATCH] percpu data: only iterate over possible CPUsEric Dumazet2-3/+3
percpu_data blindly allocates bootmem memory to store NR_CPUS instances of cpudata, instead of allocating memory only for possible cpus. As a preparation for changing that, we need to convert various 0 -> NR_CPUS loops to use for_each_cpu(). (The above only applies to users of asm-generic/percpu.h. powerpc has gone it alone and is presently only allocating memory for present CPUs, so it's currently corrupting memory). Signed-off-by: Eric Dumazet <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: James Bottomley <[email protected]> Acked-by: Ingo Molnar <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Anton Blanchard <[email protected]> Acked-by: William Irwin <[email protected]> Cc: Andi Kleen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-01-24[BONDING]: Remove CAP_NET_ADMIN requirement for INFOQUERY ioctlThomas Graf1-2/+3
This information is already available via /proc/net/bonding/* therefore it doesn't make sense to require CAP_NET_ADMIN privileges. Original patch by Laurent Deniel <[email protected]> Signed-off-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-23[NET]: Fix skb fclone error path handling.Herbert Xu1-3/+5
On the error path if we allocated an fclone then we will free it in the wrong pool. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-23[NET]: more whitespace issues in net/core/filter.cKris Katterjohn1-3/+3
This fixes some whitespace issues in net/core/filter.c Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-18[PKTGEN]: Respect hard_header_len of device.David S. Miller1-2/+3
Don't assume 16. Found by Ben Greear. Signed-off-by: David S. Miller <[email protected]>
2006-01-17[NET]: Use is_zero_ether_addr() in net/core/netpoll.cKris Katterjohn1-1/+1
This replaces a memcmp() with is_zero_ether_addr(). Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-17[PKTGEN]: Replacing with (compare|is_zero)_ether_addr() and ETH_ALENKris Katterjohn1-23/+11
This replaces some tests with is_zero_ether_addr(), memcmp(one, two, 6) with compare_ether_addr(one, two), and 6 with ETH_ALEN where appropriate. Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-17[NET]: Fix whitespace issues in net/core/filter.cKris Katterjohn1-7/+6
This fixes some whitespace issues in net/core/filter.c Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-13[NET]: Clean up comments for sk_chk_filter()Kris Katterjohn1-7/+3
This removes redundant comments, and moves one comment to a better location. Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-11[PATCH] capable/capability.h (net/)Randy Dunlap7-1/+7
net: Use <linux/capability.h> where capable() is used. Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-01-11[NET]: Fix diverter build.Evgeniy Polyakov1-1/+1
Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-11[NET]: Remove more unneeded typecasts on *malloc()Kris Katterjohn1-1/+1
This removes more unneeded casts on the return value for kmalloc(), sock_kmalloc(), and vmalloc(). Signed-off-by: Kris Katterjohn <[email protected]> Acked-by: James Morris <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-10Fix net/core/wireless.c link failureLinus Torvalds1-0/+1
It needs <linux/etherdevice.h> for compare_ether_addr()
2006-01-10[NET]: Change memcmp(,,ETH_ALEN) to compare_ether_addr()Kris Katterjohn2-2/+2
This changes some memcmp(one,two,ETH_ALEN) to compare_ether_addr(one,two). Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-10[PATCH] fix /sys/class/net/<if>/wireless without dev->get_wireless_statsAndrey Borzenkov1-9/+19
dev->get_wireless_stats is deprecated but removing it also removes wireless subdirectory in sysfs. This patch puts it back. akpm: I don't know what's happening here. This might be appropriate as a 2.6.15.x compatibility backport. Waiting to hear from Jeff. Signed-off-by: Andrey Borzenkov <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-01-09[NET]: Change some "if (x) BUG();" to "BUG_ON(x);"Kris Katterjohn2-16/+8
This changes some simple "if (x) BUG();" statements to "BUG_ON(x);" Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-06[NET]: Endian-annotate in_aton()Alexey Dobriyan1-1/+1
Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-06[PKTGEN]: Adds missing __init.Luiz Capitulino1-3/+2
pktgen_find_thread() and pktgen_create_thread() are only called at initialization time. Signed-off-by: Luiz Capitulino <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-06[NET]: Change sk_run_filter()'s return type in net/core/filter.cKris Katterjohn1-3/+3
It should return an unsigned value, and fix sk_filter() as well. Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-04Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6Linus Torvalds1-51/+25
Trivial manual merge fixup for usb_find_interface clashes.
2006-01-04Merge branch 'upstream-linus' of ↵Linus Torvalds2-2/+3
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
2006-01-04[PATCH] net: swich device attribute creation to default attrsKay Sievers1-47/+21
Recent udev versions don't longer cover bad sysfs timing with built-in logic. Explicit rules are required to do that. For net devices, the following is needed: ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" to handle access to net device properties from an event handler without races. This patch changes the main net attributes to be created by the driver core, which is done _before_ the event is sent out and will not require the stat() loop of the WAIT_FOR_SYSFS key. Signed-off-by: Kay Sievers <[email protected]> Acked-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-01-04[PATCH] driver core: replace "hotplug" by "uevent"Kay Sievers1-4/+4
Leave the overloaded "hotplug" word to susbsystems which are handling real devices. The driver core does not "plug" anything, it just exports the state to userspace and generates events. Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-01-04[NET]: More instruction checks fornet/core/filter.cKris Katterjohn1-32/+80
Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-03[NET]: Add a dev_ioctl() fallback to sock_ioctl()Christoph Hellwig1-1/+0
Currently all network protocols need to call dev_ioctl as the default fallback in their ioctl implementations. This patch adds a fallback to dev_ioctl to sock_ioctl if the protocol returned -ENOIOCTLCMD. This way all the procotol ioctl handlers can be simplified and we don't need to export dev_ioctl. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-03[NET]: Speed up __alloc_skb()Benjamin LaHaise1-14/+13
From: Benjamin LaHaise <[email protected]> In __alloc_skb(), the use of skb_shinfo() which casts a u8 * to the shared info structure results in gcc being forced to do a reload of the pointer since it has no information on possible aliasing. Fix this by using a pointer to refer to skb_shared_info. By initializing skb_shared_info sequentially, the write combining buffers can reduce the number of memory transactions to a single write. Reorder the initialization in __alloc_skb() to match the structure definition. There is also an alignment issue on 64 bit systems with skb_shared_info by converting nr_frags to a short everything packs up nicely. Also, pass the slab cache pointer according to the fclone flag instead of using two almost identical function calls. This raises bw_unix performance up to a peak of 707KB/s when combined with the spinlock patch. It should help other networking protocols, too. Signed-off-by: David S. Miller <[email protected]>
2006-01-03[INET_SOCK]: Move struct inet_sock & helper functions to net/inet_sock.hArnaldo Carvalho de Melo1-0/+1
To help in reducing the number of include dependencies, several files were touched as they were getting needed headers indirectly for stuff they use. Thanks also to Alan Menegotto for pointing out that net/dccp/proto.c had linux/dccp.h include twice. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-03[PKTGEN]: Deinitialise static variables.Jaco Kroon1-3/+3
static variables should not be explicitly initialised to 0. This causes them to be placed in .data instead of .bss. This patch de-initialises 3 static variables in net/core/pktgen.c. There are approximately 800 more such variables in the source tree (2.6.15rc5). If there is more interrest I'd be willing to track down the rest of these as well and de-initialise them as well. Signed-off-by: David S. Miller <[email protected]>
2006-01-03[TWSK]: Introduce struct timewait_sock_opsArnaldo Carvalho de Melo1-10/+11
So that we can share several timewait sockets related functions and make the timewait mini sockets infrastructure closer to the request mini sockets one. Next changesets will take advantage of this, moving more code out of TCP and DCCP v4 and v6 to common infrastructure. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-03[NET]: Avoid atomic xchg() for non-error caseBenjamin LaHaise1-3/+7
It also looks like there were 2 places where the test on sk_err was missing from the event wait logic (in sk_stream_wait_connect and sk_stream_wait_memory), while the rest of the sock_error() users look to be doing the right thing. This version of the patch fixes those, and cleans up a few places that were testing ->sk_err directly. Signed-off-by: Benjamin LaHaise <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-03[IP]: Simplify and consolidate MSG_PEEK error handlingHerbert Xu1-0/+36
When a packet is obtained from skb_recv_datagram with MSG_PEEK enabled it is left on the socket receive queue. This means that when we detect a checksum error we have to be careful when trying to free the packet as someone could have dequeued it in the time being. Currently this delicate logic is duplicated three times between UDPv4, UDPv6 and RAWv6. This patch moves them into a one place and simplifies the code somewhat. This is based on a suggestion by Eric Dumazet. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-03[LSM-IPSec]: Security association restriction.Trent Jaeger1-2/+6
This patch series implements per packet access control via the extension of the Linux Security Modules (LSM) interface by hooks in the XFRM and pfkey subsystems that leverage IPSec security associations to label packets. Extensions to the SELinux LSM are included that leverage the patch for this purpose. This patch implements the changes necessary to the XFRM subsystem, pfkey interface, ipv4/ipv6, and xfrm_user interface to restrict a socket to use only authorized security associations (or no security association) to send/receive network packets. Patch purpose: The patch is designed to enable access control per packets based on the strongly authenticated IPSec security association. Such access controls augment the existing ones based on network interface and IP address. The former are very coarse-grained, and the latter can be spoofed. By using IPSec, the system can control access to remote hosts based on cryptographic keys generated using the IPSec mechanism. This enables access control on a per-machine basis or per-application if the remote machine is running the same mechanism and trusted to enforce the access control policy. Patch design approach: The overall approach is that policy (xfrm_policy) entries set by user-level programs (e.g., setkey for ipsec-tools) are extended with a security context that is used at policy selection time in the XFRM subsystem to restrict the sockets that can send/receive packets via security associations (xfrm_states) that are built from those policies. A presentation available at www.selinux-symposium.org/2005/presentations/session2/2-3-jaeger.pdf from the SELinux symposium describes the overall approach. Patch implementation details: On output, the policy retrieved (via xfrm_policy_lookup or xfrm_sk_policy_lookup) must be authorized for the security context of the socket and the same security context is required for resultant security association (retrieved or negotiated via racoon in ipsec-tools). This is enforced in xfrm_state_find. On input, the policy retrieved must also be authorized for the socket (at __xfrm_policy_check), and the security context of the policy must also match the security association being used. The patch has virtually no impact on packets that do not use IPSec. The existing Netfilter (outgoing) and LSM rcv_skb hooks are used as before. Also, if IPSec is used without security contexts, the impact is minimal. The LSM must allow such policies to be selected for the combination of socket and remote machine, but subsequent IPSec processing proceeds as in the original case. Testing: The pfkey interface is tested using the ipsec-tools. ipsec-tools have been modified (a separate ipsec-tools patch is available for version 0.5) that supports assignment of xfrm_policy entries and security associations with security contexts via setkey and the negotiation using the security contexts via racoon. The xfrm_user interface is tested via ad hoc programs that set security contexts. These programs are also available from me, and contain programs for setting, getting, and deleting policy for testing this interface. Testing of sa functions was done by tracing kernel behavior. Signed-off-by: Trent Jaeger <[email protected]> Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-01-03Merge branch 'master'Jeff Garzik1-2/+2
2005-12-27[NET]: Validate socket filters against BPF_MAXINSNS in one spot.David S. Miller1-2/+2
Currently the checks are scattered all over and this leads to inconsistencies and even cases where the check is not made. Based upon a patch from Kris Katterjohn. Signed-off-by: David S. Miller <[email protected]>
2005-12-12Merge branch 'master'Jeff Garzik2-2/+3
2005-12-08[NET]: Fix NULL pointer deref in checksum debugging.Stephen Hemminger1-1/+2
The problem I was seeing turned out to be that skb->dev is NULL when the checksum is being completed in user context. This happens because the reference to the device is dropped (to allow it to be released when packets are in the queue). Because skb->dev was NULL, the netdev_rx_csum_fault was panicing on deref of dev->name. How about this? Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2005-12-05[NET]: make function pointer argument parseable by kernel-docMartin Waitz1-1/+1
When a function takes a function pointer as argument it should use the 'return (*pointer)(params...)' syntax used everywhere else in the kernel as this is recognized by kernel-doc. Signed-off-by: Martin Waitz <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2005-11-29Merge branch 'master'Jeff Garzik1-2/+4
2005-11-20[NET]: Reject socket filter if division by constant zero is attempted.Kris Katterjohn1-2/+4
This way we don't have to check it in sk_run_filter(). Signed-off-by: Kris Katterjohn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2005-11-13[PATCH] net: make dev_valid_name publicMitch Williams1-1/+2
dev_valid_name() is a useful function. Make it public. Signed-off-by: Mitch Williams <[email protected]> Acked-by: Jay Vosburgh <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2005-11-13[PATCH] net: allow newline terminated IP addresses in in_atonMitch Williams1-1/+1
in_aton() gives weird results if it sees a newline at the end of the input. This patch makes it able to handle such input correctly. Signed-off-by: Mitch Williams <[email protected]> Acked-by: Jay Vosburgh <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2005-11-10[NET]: Detect hardware rx checksum faults correctlyHerbert Xu3-10/+41
Here is the patch that introduces the generic skb_checksum_complete which also checks for hardware RX checksum faults. If that happens, it'll call netdev_rx_csum_fault which currently prints out a stack trace with the device name. In future it can turn off RX checksum. I've converted every spot under net/ that does RX checksum checks to use skb_checksum_complete or __skb_checksum_complete with the exceptions of: * Those places where checksums are done bit by bit. These will call netdev_rx_csum_fault directly. * The following have not been completely checked/converted: ipmr ip_vs netfilter dccp This patch is based on patches and suggestions from Stephen Hemminger and David S. Miller. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2005-11-10[RTNETLINK]: Use generic netlink receive queue processorThomas Graf1-70/+5
Signed-off-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2005-11-10[NETLINK]: Make netlink_callback->done() optionalThomas Graf1-7/+1
Most netlink families make no use of the done() callback, making it optional gets rid of all unnecessary dummy implementations. Signed-off-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2005-11-09[NETFILTER]: Add nf_conntrack subsystem.Yasuyuki Kozakai1-0/+15
The existing connection tracking subsystem in netfilter can only handle ipv4. There were basically two choices present to add connection tracking support for ipv6. We could either duplicate all of the ipv4 connection tracking code into an ipv6 counterpart, or (the choice taken by these patches) we could design a generic layer that could handle both ipv4 and ipv6 and thus requiring only one sub-protocol (TCP, UDP, etc.) connection tracking helper module to be written. In fact nf_conntrack is capable of working with any layer 3 protocol. The existing ipv4 specific conntrack code could also not deal with the pecularities of doing connection tracking on ipv6, which is also cured here. For example, these issues include: 1) ICMPv6 handling, which is used for neighbour discovery in ipv6 thus some messages such as these should not participate in connection tracking since effectively they are like ARP messages 2) fragmentation must be handled differently in ipv6, because the simplistic "defrag, connection track and NAT, refrag" (which the existing ipv4 connection tracking does) approach simply isn't feasible in ipv6 3) ipv6 extension header parsing must occur at the correct spots before and after connection tracking decisions, and there were no provisions for this in the existing connection tracking design 4) ipv6 has no need for stateful NAT The ipv4 specific conntrack layer is kept around, until all of the ipv4 specific conntrack helpers are ported over to nf_conntrack and it is feature complete. Once that occurs, the old conntrack stuff will get placed into the feature-removal-schedule and we will fully kill it off 6 months later. Signed-off-by: Yasuyuki Kozakai <[email protected]> Signed-off-by: Harald Welte <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2005-11-08[NET]: kfree cleanupJesper Juhl2-4/+2
From: Jesper Juhl <[email protected]> This is the net/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in net/. Signed-off-by: Jesper Juhl <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: Andrew Morton <[email protected]>