aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2012-02-24tipc: Eliminate a test for negative unsigned quantitiesAllan Stephens1-2/+1
Simplifies a comparison operation to eliminate a useless test that checks if an unsigned value is less than zero. Signed-off-by: Allan Stephens <[email protected]> Signed-off-by: Paul Gortmaker <[email protected]>
2012-02-24tipc: nuke the delimit static inline function.Paul Gortmaker3-15/+5
This "shortform" is actually longer than typing out what it is really trying to do, and just makes reading the code more difficult, so lets simply shoot it in the head. In the case of log.c - the comparison is on a u32, so we can drop the check for < 0 at the same time. Signed-off-by: Paul Gortmaker <[email protected]>
2012-02-24tipc: Add check to prevent insertion of duplicate name table entriesAllan Stephens1-0/+7
Adds a new check to TIPC's name table logic to reject any attempt to create a new name publication that is identical to an existing one. (Such an attempt will never happen under normal circumstances, but could arise if another network node malfunctions and issues a duplicate name publication message.) Signed-off-by: Allan Stephens <[email protected]> Signed-off-by: Paul Gortmaker <[email protected]>
2012-02-24tipc: Simplify enforcement of reserved name type prohibitionAllan Stephens5-27/+6
Streamlines the logic that prevents an application from binding a reserved TIPC name type to a port by moving the check to the code that handles a socket bind() operation. This allows internal TIPC subsystems to bind a reserved name without having to set an atomic flag to gain permission to use such a name. (This simplification is now possible due to the elimination of support for TIPC's native API.) Signed-off-by: Allan Stephens <[email protected]> Signed-off-by: Paul Gortmaker <[email protected]>
2012-02-24tipc: Remove duplicate check of message destination nodeAllan Stephens2-52/+46
Eliminates a check in the processing of TIPC messages arriving from off node that ensures the message is destined for this node, since this check duplicates an earlier check. (The check would be necessary if TIPC needed to be able to route incoming messages to another node, but the elimination of multi-cluster support means that this never happens and all incoming messages are consumed by the receiving node.) Note: This change involves the elimination of a single "if" statement with a large "then" clause; consequently, a significant number of lines end up getting re-indented. In addition, a simple message header access routine that is no longer referenced is eliminated. However, the only functional change is the elimination of the single check described above. Signed-off-by: Allan Stephens <[email protected]> Signed-off-by: Paul Gortmaker <[email protected]>
2012-02-24tipc: Detect duplicate nodes using different network interfacesAllan Stephens1-14/+58
Utilizes the new "node signature" field in neighbor discovery messages to ensure that all links TIPC associates with a given <Z.C.N> network address belong to the same neighboring node. (Previously, TIPC could not tell if link setup requests arriving on different interfaces were from the same node or from two different nodes that has mistakenly been assigned the same network address.) The revised algorithm for detecting a duplicate node considers both the node signature and the network interface adddress specified in a request message when deciding how to respond to a link setup request. This prevents false alarms that might otherwise arise during normal network operation under the following scenarios: a) A neighboring node reboots. (The node's signature changes, but the network interface address remains unchanged.) b) A neighboring node's network interface is replaced. (The node's signature remains unchanged, but the network interface address changes.) c) A neighboring node is completely replaced. (The node's signature and network interface address both change.) The algorithm also handles cases in which a node reboots and re-establishes its links to TIPC (or begins re-establishing those links) before TIPC detects that it is using a new node signature. In such cases of "delayed rediscovery" TIPC simply accepts the new signature without disrupting communication that is already underway over the links. Thanks to Laser [[email protected]] for his contributions to the development of this enhancement. Signed-off-by: Allan Stephens <[email protected]> Signed-off-by: Paul Gortmaker <[email protected]>
2012-02-24tipc: Introduce node signature field in neighbor discovery messageAllan Stephens4-0/+21
Adds support for the new "node signature" in neighbor discovery messages, which is a 16 bit identifier chosen randomly when TIPC is initialized. This field makes it possible for nodes receiving a neighbor discovery message to detect if multiple neighboring nodes are using the same network address (i.e. <Z.C.N>), even when the messages are arriving on different interfaces. This first phase of node signature support creates the signature, incorporates it into outgoing neighbor discovery messages, and tracks the signature used by valid neighbors. An upcoming patch builds on this foundation to implement the improved duplicate neighbor detection checking. Signed-off-by: Allan Stephens <[email protected]> Signed-off-by: Paul Gortmaker <[email protected]>
2012-02-24net: Add missing getsockopt for SO_NOFCS.David S. Miller1-0/+3
Signed-off-by: David S. Miller <[email protected]>
2012-02-24Bluetooth: Remove duplicated code in l2cap conn reqAndrei Emeltchenko1-30/+19
The same sequence sending L2CAP Connection Request was used in several places. Using subroutine makes those places easy to read. Signed-off-by: Andrei Emeltchenko <[email protected]> Reviewed-by: Ulisses Furquim <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2012-02-24Bluetooth: Fix double locking in LE and conless chanAndrei Emeltchenko1-20/+4
Remove socket lock since chan->ops->recv locks socket itself. Signed-off-by: Andrei Emeltchenko <[email protected]> Reviewed-by: Ulisses Furquim <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2012-02-24Bluetooth: Fix init request completion with AMP controllersAndrei Emeltchenko1-1/+4
Mark request status as done for Read Local Version HCI command. In AMP initialization this HCI command is the last and needs to be completed. Signed-off-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2012-02-24Bluetooth: Fix init request completion with old controllersJohan Hedberg1-0/+2
With Bluetooth 1.1 controllers the last command in the HCI init sequence will be a write_local_name, however there was no callback to indicate init request completion in this case. This patch fixes the issue by adding the necessary callback to the write_local_name_complete handler. Signed-off-by: Johan Hedberg <[email protected]>
2012-02-24netfilter: ctnetlink: fix soft lockup when netlink adds new entries (v2)Jozsef Kadlecsik2-34/+50
Marcell Zambo and Janos Farago noticed and reported that when new conntrack entries are added via netlink and the conntrack table gets full, soft lockup happens. This is because the nf_conntrack_lock is held while nf_conntrack_alloc is called, which is in turn wants to lock nf_conntrack_lock while evicting entries from the full table. The patch fixes the soft lockup with limiting the holding of the nf_conntrack_lock to the minimum, where it's absolutely required. It required to extend (and thus change) nf_conntrack_hash_insert so that it makes sure conntrack and ctnetlink do not add the same entry twice to the conntrack table. Signed-off-by: Jozsef Kadlecsik <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
2012-02-24Revert "netfilter: ctnetlink: fix soft lockup when netlink adds new entries"Pablo Neira Ayuso1-16/+27
This reverts commit af14cca162ddcdea017b648c21b9b091e4bf1fa4. This patch contains a race condition between packets and ctnetlink in the conntrack addition. A new patch to fix this issue follows up. Signed-off-by: Pablo Neira Ayuso <[email protected]>
2012-02-24net: Support RX-ALL feature flag.Ben Greear1-0/+1
This flag requests that network devices pass all received frames up the stack, even ones with errors such as invalid FCS (frame check sum). This will allow sniffers to see bad packets and perhaps give the user some idea how to fix the problem. Signed-off-by: Ben Greear <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-02-24net: Add framework to allow sending packets with customized CRC.Ben Greear3-4/+34
This is useful for testing RX handling of frames with bad CRCs. Requires driver support to actually put the packet on the wire properly. Signed-off-by: Ben Greear <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-02-24net: Support RXFCS feature flag.Ben Greear1-0/+1
When set on hardware that supports the feature, this causes the Ethernet FCS to be appended to the end of the skb. Useful for sniffing packets. Signed-off-by: Ben Greear <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-02-24static keys: Introduce 'struct static_key', static_key_true()/false() and ↵Ingo Molnar6-24/+24
static_key_slow_[inc|dec]() So here's a boot tested patch on top of Jason's series that does all the cleanups I talked about and turns jump labels into a more intuitive to use facility. It should also address the various misconceptions and confusions that surround jump labels. Typical usage scenarios: #include <linux/static_key.h> struct static_key key = STATIC_KEY_INIT_TRUE; if (static_key_false(&key)) do unlikely code else do likely code Or: if (static_key_true(&key)) do likely code else do unlikely code The static key is modified via: static_key_slow_inc(&key); ... static_key_slow_dec(&key); The 'slow' prefix makes it abundantly clear that this is an expensive operation. I've updated all in-kernel code to use this everywhere. Note that I (intentionally) have not pushed through the rename blindly through to the lowest levels: the actual jump-label patching arch facility should be named like that, so we want to decouple jump labels from the static-key facility a bit. On non-jump-label enabled architectures static keys default to likely()/unlikely() branches. Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Jason Baron <[email protected]> Acked-by: Steven Rostedt <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Linus Torvalds <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2012-02-24Bluetooth: mgmt: Fix clear_uuids responseJohan Hedberg1-4/+19
Since the clear_uuids operation doesn't send an immediate HCI command but just sets off a timer to wait for subsequent add_uuid calls it doesn't make sense to wait until the timer fires off to send the response. Instead send the response immediately. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-24Bluetooth: mgmt: Fix dev_class related command response timingJohan Hedberg1-5/+65
All mgmt commands that may fire off a hci_write_class_of_device command should wait for the completion of the HCI command before sending a response to user space. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-24Bluetooth: mgmt: Track pending class changesJohan Hedberg1-2/+27
This patch adds a flag to track pending changes to the class of device. This is needed since we cannot cleanly handle multiple simultaneous commands and need to return a "busy" error status in the mgmt commands that might trigger a class change. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23br_device: unify return value of .ndo_set_mac_address if address is invalidDanny Kukawka1-1/+1
Unify return value of .ndo_set_mac_address if the given address isn't valid. Return -EADDRNOTAVAIL as eth_mac_addr() already does if is_valid_ether_addr() fails. Signed-off-by: Danny Kukawka <[email protected]> Acked-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-23ipsec: be careful of non existing mac headersEric Dumazet4-17/+6
Niccolo Belli reported ipsec crashes in case we handle a frame without mac header (atm in his case) Before copying mac header, better make sure it is present. Bugzilla reference: https://bugzilla.kernel.org/show_bug.cgi?id=42809 Reported-by: Niccolò Belli <[email protected]> Tested-by: Niccolò Belli <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-23Bluetooth: mgmt: Add flags parameter to device_connectedJohan Hedberg2-6/+8
This patch updates the Device Connected events to match the latest API by adding a flags parameter to them. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Fix clear UUIDs responseJohan Hedberg1-1/+2
We also need to send a proper response when clearing UUIDs. This patch adds fixes the missing response for this use case. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Move service cache setting to a more sensible placeJohan Hedberg1-4/+6
Since we can now add UUIDs when powered off we don't really need to always use the service cache to avoid large bursts of HCI commands. Instead, the only important use case is when we're already powered and user space starts to initialize itself. This can be easiest detected by a "clear UUIDs" operation which is where this patch moves the service cache setting. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Fix return value of add/remove_uuidJohan Hedberg1-2/+3
The Add/Remove UUID commands should return the device class instead of an empty parameter list. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag setJohan Hedberg1-2/+5
If we're powered but still have the HCI_AUTO_OFF flag set the update_eir and update_class functions should not do anything. Additionally these functions need to be called when the flag is finally cleared through set_powered or when powering on for real. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: Set DISCOVERY_STOPPED if controller resetsAndre Guedes1-0/+2
If controller is reset during the discovery procedure, Start Discovery command stops working. This can be easily reproduced by running "hciconfig hci0 reset" while discovering devices, for instance. We should force discovery state to DISCOVERY_STOPPED in case we receive a reset command complete event. Otherwise we may stuck in one of the active discovery states (DISCOVERY_INQUIRY, DISCOVERY_LE_SCAN and DISCOVERY_RESOLVING) and subsequent Start Discovery commands will simply fail. Signed-off-by: Andre Guedes <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2012-02-23Bluetooth: mgmt: Fix count parameter in get_connections replyJohan Hedberg1-7/+7
This patch fixes the count parameter in the Get Connections reply message. We cannot know the right number until iterating through all connections so set the parameter value only after the loop. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: Remove socket lock checkAndrei Emeltchenko1-4/+4
Simplify code so that we do not need to check whether socket is locked. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2012-02-23Bluetooth: Change sk lock to chan lock in L2CAP coreAndrei Emeltchenko2-70/+114
Change sk lock to chan lock in l2cap core and move sk locks to l2cap sock code. bh_locks were used because of being RCU critical section. When needed use explicit socket locks. Signed-off-by: Andrei Emeltchenko <[email protected]> Reviewed-by: Ulisses Furquim <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2012-02-23Bluetooth: Add unlocked __l2cap_chan_add functionAndrei Emeltchenko1-2/+7
Add unlocked L2CAP channel add function. Unlocked version will be used in later patches. Signed-off-by: Andrei Emeltchenko <[email protected]> Reviewed-by: Ulisses Furquim <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2012-02-23Bluetooth: mgmt: Add legacy pairing info to dev_found eventsJohan Hedberg3-14/+24
This patch makes sure that legacy pairing vs SSP infomation gets properly propageted to the device_found events in the form of the legacy pairing flag. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Fix device_found parametersJohan Hedberg1-1/+2
According to the latest mgmt API there's a flags field instead of a separate confirm_name paramter. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Fix unpair_device responsesJohan Hedberg1-17/+19
This patch adds an error return when not powered and cleans up/simpifies the function logic in the same go. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Add missing powered checks to commandsJohan Hedberg1-1/+36
This patch adds missing powered checks to pair_device, cancel_pair_device, add_remote_oob_data and remove_remote_oob_data. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Allow class of device changes while powered offJohan Hedberg1-5/+5
This patch makes it possible to set the class when powered off. When powering on the right class of device value will be automatically writen to the controller. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Check for HCI_UP in update_eir() and update_class()Johan Hedberg1-0/+6
These functions should just silently fail when we're not powered on instead of trying to send HCI commands. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Fix return value for set_classJohan Hedberg1-1/+1
The return parameters for Set Device Class should consist of the new class value. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: Fix clearing of dev_class when powering downJohan Hedberg1-0/+1
We should assume a value of 0 for the device class when powered off. The appropriate place to do this is in hci_dev_do_close(). Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Fix missing short_name in read_infoJohan Hedberg1-0/+1
The short name is part of the Read Controller Info response and should be appropriately filled in based on the value of hdev->short_name. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Fix name_changed event for short name changesJohan Hedberg1-0/+4
Since we can't reliably track the short name changes just assume that we had a change whenever there's a pending mgmt command. In the worst case we just get one unnecessary name_changed signal. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: mgmt: Allow local name changes while powered offJohan Hedberg2-15/+36
This patch makes it possible to set the local name before powering on the device. The name will be applied using the hci_write_local_name command once the device gets powered on. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: Fix read_name updating when HCI_SETUP is not setJohan Hedberg1-1/+2
The local name should only be updated as a consequence of a hci_read_local_name if we are in the HCI_SETUP state. In all other scenarios it should only be updated through hci_write_local_name. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: Add hdev->short_name for EIR generationJohan Hedberg1-0/+3
It's possible to provide a short name through the mgmt interface and this name can be used for EIR generation when the full name doesn't fit there. This patch adds the preliminary tracking of the provided short name. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>
2012-02-23Bluetooth: Send management event for class of device changesMarcel Holtmann2-4/+19
Currently there are no events to other management sockets if the class of device got changed. So make sure they are sent. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2012-02-23Bluetooth: Fix handling of discoverable setting with timeoutMarcel Holtmann1-0/+11
The current handling of the discoverable timeout was missing the proper handling of the timeout when the mode was already set. Now the command can be used to expire or retrigger the timeout. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2012-02-23Bluetooth: Disabling discoverable with timeout is invalidMarcel Holtmann1-2/+5
Add one extra sanity check to ensure that the supplied timeout value is actually valid in this context. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2012-02-23Bluetooth: mgmt: Fix updating EIR when updating the nameJohan Hedberg2-3/+4
Whenever we update the local device name the EIR data also needs to be updated to reflect this. The update_eir() function in mgmt.c depends on hdev->dev_name to be up to date so the patch also makes sure that the mgmt function is called from hci_event.c after the update has happened. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]>