aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2011-03-07ipv4: Cache source address in nexthop entries.David S. Miller2-7/+26
When doing output route lookups, we have to select the source address if the user has not specified an explicit one. First, if the route has an explicit preferred source address specified, then we use that. Otherwise we search the route's outgoing interface for a suitable address. This search can be precomputed and cached at route insertion time. The only missing part is that we have to refresh this precomputed value any time addresses are added or removed from the interface, and this is accomplished by fib_update_nh_saddrs(). Signed-off-by: David S. Miller <[email protected]>
2011-03-07vlan: add support to ndo_fcoe_ddp_target()Yi Zou1-0/+14
Add the new target ddp offload support ndo_fcoe_ddp_target(). Signed-off-by: Yi Zou <[email protected]> Signed-off-by: Kiran Patil <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2011-03-08KEYS: Add a key type op to permit the key description to be vettedDavid Howells1-0/+19
Add a key type operation to permit the key type to vet the description of a new key that key_alloc() is about to allocate. The operation may reject the description if it wishes with an error of its choosing. If it does this, the key will not be allocated. Signed-off-by: David Howells <[email protected]> Reviewed-by: Mimi Zohar <[email protected]> Signed-off-by: James Morris <[email protected]>
2011-03-07af_unix: remove unused struct sockaddr_un cruftHagen Paul Pfeifer1-2/+0
Signed-off-by: Hagen Paul Pfeifer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-07sctp: several declared/set but unused fixesHagen Paul Pfeifer6-18/+1
Signed-off-by: Hagen Paul Pfeifer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-07af_packet: struct socket declared/assigned but unusedHagen Paul Pfeifer1-3/+0
Signed-off-by: Hagen Paul Pfeifer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-07mcast: net_device dev not usedHagen Paul Pfeifer1-6/+0
ip6_mc_source(), ip6_mc_msfilter() as well as ip6_mc_msfget() declare and assign dev but do not use the variable afterwards. Signed-off-by: Hagen Paul Pfeifer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-07net: allow handlers to be processed for orig_devJiri Pirko1-1/+2
This was there before, I forgot about this. Allows deliveries to ptype_base handlers registered for orig_dev. I presume this is still desired. Signed-off-by: Jiri Pirko <[email protected]> Reviewed-by: Nicolas de Pesloüan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-07net: fix multithreaded signal handling in unix recv routinesRainer Weikusat1-4/+13
The unix_dgram_recvmsg and unix_stream_recvmsg routines in net/af_unix.c utilize mutex_lock(&u->readlock) calls in order to serialize read operations of multiple threads on a single socket. This implies that, if all n threads of a process block in an AF_UNIX recv call trying to read data from the same socket, one of these threads will be sleeping in state TASK_INTERRUPTIBLE and all others in state TASK_UNINTERRUPTIBLE. Provided that a particular signal is supposed to be handled by a signal handler defined by the process and that none of this threads is blocking the signal, the complete_signal routine in kernel/signal.c will select the 'first' such thread it happens to encounter when deciding which thread to notify that a signal is supposed to be handled and if this is one of the TASK_UNINTERRUPTIBLE threads, the signal won't be handled until the one thread not blocking on the u->readlock mutex is woken up because some data to process has arrived (if this ever happens). The included patch fixes this by changing mutex_lock to mutex_lock_interruptible and handling possible error returns in the same way interruptions are handled by the actual receive-code. Signed-off-by: Rainer Weikusat <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-07ipv4: Inline fib_semantic_match into check_leafDavid S. Miller3-75/+51
This elimiates a lot of pure overhead due to parameter passing. Signed-off-by: David S. Miller <[email protected]>
2011-03-07ipv4: Validate route entry type at insert instead of every lookup.David S. Miller1-26/+28
fib_semantic_match() requires that if the type doesn't signal an automatic error, it must be of type RTN_UNICAST, RTN_LOCAL, RTN_BROADCAST, RTN_ANYCAST, or RTN_MULTICAST. Checking this every route lookup is pointless work. Instead validate it during route insertion, via fib_create_info(). Also, there was nothing making sure the type value was less than RTN_MAX, so add that missing check while we're here. Signed-off-by: David S. Miller <[email protected]>
2011-03-07net: Enter net/ipv6/ even if CONFIG_IPV6=nThomas Graf1-3/+1
exthdrs_core.c and addrconf_core.c in net/ipv6/ contain bits which must be made available even if IPv6 is disabled. net/ipv6/Makefile already correctly includes them if CONFIG_IPV6=n but net/Makefile prevents entering the subdirectory. Signed-off-by: Thomas Graf <[email protected]> Acked-by: Randy Dunlap <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-07mac80211: fix scan race, simplify codeJohannes Berg1-40/+24
The scan code has a race that Michael reported he ran into, but it's easy to fix while at the same time simplifying the code. The race resulted in the following warning: ------------[ cut here ]------------ WARNING: at net/mac80211/scan.c:310 ieee80211_rx_bss_free+0x20c/0x4b8 [mac80211]() Modules linked in: [...] [<c0033edc>] (unwind_backtrace+0x0/0xe0) from [<c004f2a4>] (warn_slowpath_common+0x4c/0x64) [... backtrace wasn't useful ...] Reported-by: Michael Buesch <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-03-07mac80211: Add log message to ieee80211_restart_hw()Michael Buesch1-0/+3
Add a log message to ieee80211_restart_hw() to highlight that special codepath in the logs. This helps debugging bugs in the rarely tested restart code. Signed-off-by: Michael Buesch <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-03-07mac80211: remove unused macrosShan Wei3-5/+0
Compile test only. Signed-off-by: Shan Wei <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-03-07gss:krb5 only include enctype numbers in gm_upcall_enctypesKevin Coffman2-2/+2
Make the value in gm_upcall_enctypes just the enctype values. This allows the values to be used more easily elsewhere. Signed-off-by: Kevin Coffman <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2011-03-07Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-mergeDavid S. Miller24-1232/+1634
2011-03-05Merge branch 'for-linus' of ↵Linus Torvalds2-22/+67
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: ceph: no .snap inside of snapped namespace libceph: fix msgr standby handling libceph: fix msgr keepalive flag libceph: fix msgr backoff libceph: retry after authorization failure libceph: fix handling of short returns from get_user_pages ceph: do not clear I_COMPLETE from d_release ceph: do not set I_COMPLETE Revert "ceph: keep reference to parent inode on ceph_dentry"
2011-03-05batman-adv: Disallow regular interface as mesh deviceSven Eckelmann3-12/+36
When trying to associate a net_device with another net_device which already exists, batman-adv assumes that this interface is a fully initialized batman mesh interface without checking it. The behaviour when accessing data behind netdev_priv of a random net_device is undefined and potentially dangerous. Reported-by: Linus Lüssing <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: Remove unused hdr_size variable in route_unicast_packet()Linus Lüssing3-7/+5
Signed-off-by: Linus Lüssing <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: rename batman_if struct to hard_ifaceMarek Lindner18-330/+335
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: rename global if_list to hardif_listMarek Lindner6-22/+22
Batman-adv works with "hard interfaces" as well as "soft interfaces". The new name should better make clear which kind of interfaces this list stores. Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: remove orig_hash spinlockMarek Lindner7-148/+38
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: increase refcount in create_neighbor to be consistentMarek Lindner2-37/+30
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: Correct rcu refcounting for orig_nodeMarek Lindner9-36/+49
It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race condition all refcount operations have to be atomic. Reported-by: Sven Eckelmann <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: remove extra layer between hash and hash element - hash bucketMarek Lindner10-294/+298
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: separate ethernet comparing calls from hash functionsMarek Lindner8-42/+51
Note: The function compare_ether_addr() provided by the Linux kernel requires aligned memory. Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: Fix possible buffer overflow in softif neigh list outputLinus Lüssing1-21/+1
When printing the soft interface table the number of entries in the softif neigh list are first being counted and a fitting buffer allocated. After that the softif neigh list gets locked again and the buffer printed - which has the following two issues: For one thing, the softif neigh list might have grown when reacquiring the rcu lock, which results in writing outside of the allocated buffer. Furthermore 31 Bytes are not enough for printing an entry with a vid of more than 2 digits. The manual buffering is unnecessary, we can safely print to the seq directly during the rcu_read_lock(). Signed-off-by: Linus Lüssing <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: Increase orig_node refcount before releasing rcu read lockLinus Lüssing2-3/+5
When unicast_send_skb() is increasing the orig_node's refcount another thread might have been freeing this orig_node already. We need to increase the refcount in the rcu read lock protected area to avoid that. Signed-off-by: Linus Lüssing <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: Make bat_priv->curr_gw an rcu protected pointerLinus Lüssing2-32/+72
The rcu protected macros rcu_dereference() and rcu_assign_pointer() for the bat_priv->curr_gw need to be used, as well as spin/rcu locking. Otherwise we might end up using a curr_gw pointer pointing to already freed memory. Reported-by: Sven Eckelmann <[email protected]> Signed-off-by: Linus Lüssing <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: make broadcast seqno operations atomicMarek Lindner3-22/+37
Batman-adv could receive several payload broadcasts at the same time that would trigger access to the broadcast seqno sliding window to determine whether this is a new broadcast or not. If these incoming broadcasts are accessing the sliding window simultaneously it could be left in an inconsistent state. Therefore it is necessary to make sure this access is atomic. Reported-by: Linus Lüssing <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: protect bit operations to count OGMs with spinlockMarek Lindner2-34/+33
Reported-by: Linus Lüssing <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: Correct rcu refcounting for batman_ifMarek Lindner4-38/+33
It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race condition all refcount operations have to be atomic. Reported-by: Sven Eckelmann <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: Correct rcu refcounting for softif_neighMarek Lindner2-17/+16
It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race condition all refcount operations have to be atomic. Reported-by: Sven Eckelmann <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: Correct rcu refcounting for gw_nodeMarek Lindner2-22/+17
It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race condition all refcount operations have to be atomic. Reported-by: Sven Eckelmann <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: Correct rcu refcounting for neigh_nodeMarek Lindner7-174/+313
It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race condition all refcount operations have to be atomic. Reported-by: Sven Eckelmann <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: protect bonding with rcu locksSimon Wunderlich7-163/+195
bonding / alternating candidates need to be secured by rcu locks as well. This patch therefore converts the bonding list from a plain pointer list to a rcu securable lists and references the bonding candidates. Signed-off-by: Simon Wunderlich <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: protect ogm counter arrays with spinlockMarek Lindner3-6/+33
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: protect originator nodes with reference countersMarek Lindner4-19/+78
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: protect each hash row with rcu locksMarek Lindner8-45/+141
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: protect neigh_nodes used outside of rcu_locks with refcountingMarek Lindner1-9/+31
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: free neighbors when an interface is deactivatedMarek Lindner1-2/+7
hardif_disable_interface() calls purge_orig_ref() to immediately free all neighbors associated with the interface that is going down. purge_orig_neighbors() checked if the interface status is IF_INACTIVE which is set to IF_NOT_IN_USE shortly before calling purge_orig_ref(). Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: protect neighbor list with rcu locksMarek Lindner3-21/+57
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: convert neighbor list to hlistMarek Lindner3-28/+35
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05batman-adv: protect neighbor nodes with reference countersMarek Lindner4-8/+28
Signed-off-by: Marek Lindner <[email protected]>
2011-03-05ipx: remove the BKLArnd Bergmann2-33/+20
This replaces all instances of lock_kernel in the IPX code with lock_sock. As far as I can tell, this is safe to do, because there is no global state that needs to be locked in IPX, and the code does not recursively take the lock or sleep indefinitely while holding it. Compile-tested only. Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: David S. Miller <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: [email protected]
2011-03-05appletalk: remove the BKLArnd Bergmann1-24/+16
This changes appletalk to use lock_sock instead of lock_kernel for serialization. I tried to make sure that we don't hold the socket lock during sleeping functions, but I did not try to prove whether the locks are necessary in the first place. Compile-tested only. Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: David S. Miller <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: David Miller <[email protected]> Cc: [email protected]
2011-03-05x25: remove the BKLArnd Bergmann3-43/+23
This replaces all instances of lock_kernel in x25 with lock_sock, taking care to release the socket lock around sleeping functions (sock_alloc_send_skb and skb_recv_datagram). It is not clear whether this is a correct solution, but it seem to be what other protocols do in the same situation. Includes a fix suggested by Eric Dumazet. Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: David S. Miller <[email protected]> Tested-by: Andrew Hendry <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Eric Dumazet <[email protected]>
2011-03-04ipv4: Remove flowi from struct rtable.David S. Miller6-85/+133
The only necessary parts are the src/dst addresses, the interface indexes, the TOS, and the mark. The rest is unnecessary bloat, which amounts to nearly 50 bytes on 64-bit. Signed-off-by: David S. Miller <[email protected]>
2011-03-04ipv4: Set rt->rt_iif more sanely on output routes.David S. Miller1-1/+1
rt->rt_iif is only ever inspected on input routes, for example DCCP uses this to populate a route lookup flow key when generating replies to another packet. Therefore, setting it to anything other than zero on output routes makes no sense. Signed-off-by: David S. Miller <[email protected]>