aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2015-01-25net: ipv6: Add sysctl entry to disable MTU updates from RAHarout Hedeshian2-1/+11
The kernel forcefully applies MTU values received in router advertisements provided the new MTU is less than the current. This behavior is undesirable when the user space is managing the MTU. Instead a sysctl flag 'accept_ra_mtu' is introduced such that the user space can control whether or not RA provided MTU updates should be applied. The default behavior is unchanged; user space must explicitly set this flag to 0 for RA MTUs to be ignored. Signed-off-by: Harout Hedeshian <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-25fib_trie: Various clean-ups for handling slenAlexander Duyck1-20/+29
While doing further work on the fib_trie I noted a few items. First I was using calls that were far more complicated than they needed to be for determining when to push/pull the suffix length. I have updated the code to reflect the simplier logic. The second issue is that I realised we weren't necessarily handling the case of a leaf_info struct surviving a flush. I have updated the logic so that now we will call pull_suffix in the event of having a leaf info value left in the leaf after flushing it. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-25fib_trie: Move fib_find_alias to file where it is usedAlexander Duyck3-19/+20
The function fib_find_alias is only accessed by functions in fib_trie.c as such it makes sense to relocate it and cast it as static so that the compiler can take advantage of optimizations it can do to it as a local function. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-25fib_trie: Use empty_children instead of counting empty nodes in stats collectionAlexander Duyck1-7/+1
It doesn't make much sense to count the pointers ourselves when empty_children already has a count for the number of NULL pointers stored in the tnode. As such save ourselves the cycles and just use empty_children. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-25fib_trie: Add collapse() and should_collapse() to resizeAlexander Duyck1-35/+65
This patch really does two things. First it pulls the logic for determining if we should collapse one node out of the tree and the actual code doing the collapse into a separate pair of functions. This helps to make the changes to these areas more readable. Second it encodes the upper 32b of the empty_children value onto the full_children value in the case of bits == KEYLENGTH. By doing this we are able to handle the case of a 32b node where empty_children would appear to be 0 when it was actually 1ul << 32. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-25fib_trie: Fall back to slen update on inflate/halve failureAlexander Duyck1-5/+5
This change corrects an issue where if inflate or halve fails we were exiting the resize function without at least updating the slen for the node. To correct this I have moved the update of max_size into the while loop so that it is only decremented on a successful call to either inflate or halve. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-25fib_trie: Fix RCU bug and merge similar bits of inflate/halveAlexander Duyck1-84/+73
This patch addresses two issues. The first issue is the fact that I believe I had the RCU freeing sequence slightly out of order. As a result we could get into an issue if a caller went into a child of a child of the new node, then backtraced into the to be freed parent, and then attempted to access a child of a child that may have been consumed in a resize of one of the new nodes children. To resolve this I have moved the resize after we have freed the oldtnode. The only side effect of this is that we will now be calling resize on more nodes in the case of inflate due to the fact that we don't have a good way to test to see if a full_tnode on the new node was there before or after the allocation. This should have minimal impact however since the node should already be correctly size so it is just the cost of calling should_inflate that we will be taking on the node which is only a couple of cycles. The second issue is the fact that inflate and halve were essentially doing the same thing after the new node was added to the trie replacing the old one. As such it wasn't really necessary to keep the code in both functions so I have split it out into two other functions, called replace and update_children. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-25fib_trie: Use index & (~0ul << n->bits) instead of index >> n->bitsAlexander Duyck1-8/+8
In doing performance testing and analysis of the changes I recently found that by shifting the index I had created an unnecessary dependency. I have updated the code so that we instead shift a mask by bits and then just test against that as that should save us about 2 CPU cycles since we can generate the mask while the key and pos are being processed. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-25net: llc: use correct size for sysctl timeout entriesSasha Levin1-4/+4
The timeout entries are sizeof(int) rather than sizeof(long), which means that when they were getting read we'd also leak kernel memory to userspace along with the timeout values. Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-24vxlan: Eliminate dependency on UDP socket in transmit pathTom Herbert1-4/+2
In the vxlan transmit path there is no need to reference the socket for a tunnel which is needed for the receive side. We do, however, need the vxlan_dev flags. This patch eliminate references to the socket in the transmit path, and changes VXLAN_F_UNSHAREABLE to be VXLAN_F_RCV_FLAGS. This mask is used to store the flags applicable to receive (GBP, CSUM6_RX, and REMCSUM_RX) in the vxlan_sock flags. Signed-off-by: Tom Herbert <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-24udp: Do not require sock in udp_tunnel_xmit_skbTom Herbert3-14/+15
The UDP tunnel transmit functions udp_tunnel_xmit_skb and udp_tunnel6_xmit_skb include a socket argument. The socket being passed to the functions (from VXLAN) is a UDP created for receive side. The only thing that the socket is used for in the transmit functions is to get the setting for checksum (enabled or zero). This patch removes the argument and and adds a nocheck argument for checksum setting. This eliminates the unnecessary dependency on a UDP socket for UDP tunnel transmit. Signed-off-by: Tom Herbert <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-24SUNRPC: Allow waiting on memory allocationTrond Myklebust1-2/+2
We should be safe now, as long as we don't do GFP_IO or higher allocations Signed-off-by: Trond Myklebust <[email protected]>
2015-01-24SUNRPC: Adjust rpciod workqueue parametersTrond Myklebust1-1/+2
Increase the concurrency level for rpciod threads to allow for allocations etc that happen in the RPCSEC_GSS layer. Also note that the NFSv4 byte range locks may now need to allocate memory from inside rpciod. Add the WQ_HIGHPRI flag to improve latency guarantees while we're at it. Signed-off-by: Trond Myklebust <[email protected]>
2015-01-23vxlan: advertise netns of vxlan dev in fdb msgNicolas Dichtel1-0/+1
Netlink FDB messages are sent in the link netns. The header of these messages contains the ifindex (ndm_ifindex) of the netdevice, but this ifindex is unusable in case of x-netns vxlan. I named the new attribute NDA_NDM_IFINDEX_NETNSID, to avoid confusion with NDA_IFINDEX. Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-23vlan: advertise link netns via netlinkNicolas Dichtel1-0/+8
Assign rtnl_link_ops->get_link_net() callback so that IFLA_LINK_NETNSID is added to rtnetlink messages. Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-23ip6gretap: advertise link netns via netlinkNicolas Dichtel1-0/+1
Assign rtnl_link_ops->get_link_net() callback so that IFLA_LINK_NETNSID is added to rtnetlink messages. Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-23rtnl: fix error path when adding an iface with a link netNicolas Dichtel1-1/+4
If an error occurs when the netdevice is moved to the link netns, a full cleanup must be done. Fixes: 317f4810e45e ("rtnl: allow to create device with IFLA_LINK_NETNSID set") Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-23act_connmark: Add missing dependency on NF_CONNTRACK_MARKThomas Graf1-0/+1
Depending on NETFILTER is not sufficient to ensure the presence of the 'mark' field in nf_conn, also needs to depend on NF_CONNTRACK_MARK. Fixes: 22a5dc ("net: sched: Introduce connmark action") Cc: Felix Fietkau <[email protected]> Cc: Jamal Hadi Salim <[email protected]> Signed-off-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-23Bluetooth: Fix nested sleepsPeter Hurley3-15/+11
l2cap/rfcomm/sco_sock_accept() are wait loops which may acquire sleeping locks. Since both wait loops and sleeping locks use task_struct.state to sleep and wake, the nested sleeping locks destroy the wait loop state. Use the newly-minted wait_woken() and DEFINE_WAIT_FUNC() for the wait loop. DEFINE_WAIT_FUNC() allows an alternate wake function to be specified; in this case, the predefined scheduler function, woken_wake_function(). This wait construct ensures wakeups will not be missed without requiring the wait loop to set the task state before condition evaluation. How this works: CPU 0 | CPU 1 | | is <condition> set? | no set <condition> | | wake_up_interruptible | woken_wake_function | set WQ_FLAG_WOKEN | try_to_wake_up | | wait_woken | set TASK_INTERRUPTIBLE | WQ_FLAG_WOKEN? yes | set TASK_RUNNING | | - loop - | | is <condition> set? | yes - exit wait loop Fixes "do not call blocking ops when !TASK_RUNNING" warnings in l2cap_sock_accept(), rfcomm_sock_accept() and sco_sock_accept(). Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2015-01-23Bluetooth: Convert Set SC to use HCI RequestJohan Hedberg2-46/+50
This patch converts the Set Secure Connection HCI handling to use a HCI request instead of using a hard-coded callback in hci_event.c. This e.g. ensures that we don't clear the flags incorrectly if something goes wrong with the power up process (not related to a mgmt Set SC command). The code can also be simplified a bit since only one pending Set SC command is allowed, i.e. mgmt_pending_foreach usage is not needed. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2015-01-23Bluetooth: Remove incorrect check for BDADDR_BREDR address typeJohan Hedberg1-8/+0
The Add Remote OOB Data mgmt command should allow data to be passed for LE as well. This patch removes a left-over check for BDADDR_BREDR that should not be there anymore. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2015-01-23Bluetooth: Check for valid bdaddr in add_remote_oob_dataJohan Hedberg1-0/+6
Before doing any other verifications, the add_remote_oob_data function should first check that the given address is valid. This patch adds such a missing check to the beginning of the function. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2015-01-23sunrpc/lockd: fix references to the BKLJeff Layton2-4/+3
The BKL is completely out of the picture in the lockd and sunrpc code these days. Update the antiquated comments that refer to it. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
2015-01-23mac80211: support beacon statisticsJohannes Berg1-0/+14
For drivers without beacon filtering, support beacon statistics entirely, i.e. report the number of beacons and average signal. For drivers with beacon filtering, give them the number of beacons received by mac80211 -- in case the device reports only the number of filtered beacons then driver doesn't have to count all beacons again as mac80211 already does. Signed-off-by: Johannes Berg <[email protected]>
2015-01-23mac80211: fix per-TID RX-MSDU counterJohannes Berg1-2/+2
In the case of non-QoS association, the counter was actually wrong. The right index isn't security_idx but seqno_idx, as security_idx will be 0 for data frames, while 16 is needed. Signed-off-by: Johannes Berg <[email protected]>
2015-01-23mac80211: tdls: disentangle HT supported conditionsJohannes Berg1-18/+18
These conditions are rather difficult to follow, for example because "!sta" only exists to not crash in the case that we don't have a station pointer (WLAN_TDLS_SETUP_REQUEST) in which the additional condition (peer supports HT) doesn't actually matter anyway. Cleaning this up only duplicates two lines of code but makes the rest far easier to read, so do that. As a side effect, smatch stops complaining about the lack of a sta pointer test after the !sta (since the !sta goes away) Signed-off-by: Johannes Berg <[email protected]>
2015-01-23mac80211: tdls: remove shadowing variableJohannes Berg1-1/+0
There's no need to use another local 'sta' variable as the original (outer scope) one isn't needed any more and has become invalid anyway when exiting the RCU read section. Remove the inner scope one and along with it the useless NULL initialization. Signed-off-by: Johannes Berg <[email protected]>
2015-01-23nl80211: suppress smatch warningsJohannes Berg1-5/+5
smatch warns that we once checked request->ssids in two functions and then unconditionally used it later again. This is actually fine, because the code has a relationship between attrs[NL80211_ATTR_SCAN_SSIDS], n_ssids and request->ssids, but smatch isn't smart enough to realize that. Suppress the warnings by always checking just n_ssids - that way smatch won't know that request->ssids could be NULL, and since it is only NULL when n_ssids is 0 we still check everything correctly. Signed-off-by: Johannes Berg <[email protected]>
2015-01-23nl80211: fix per-station group key get/del and memory leakJohannes Berg1-5/+4
In case userspace attempts to obtain key information for or delete a unicast key, this is currently erroneously rejected unless the driver sets the WIPHY_FLAG_IBSS_RSN flag. Apparently enough drivers do so it was never noticed. Fix that, and while at it fix a potential memory leak: the error path in the get_key() function was placed after allocating a message but didn't free it - move it to a better place. Luckily admin permissions are needed to call this operation. Cc: [email protected] Fixes: e31b82136d1ad ("cfg80211/mac80211: allow per-station GTKs") Signed-off-by: Johannes Berg <[email protected]>
2015-01-23Revert "mac80211: keep sending peer candidate events while in listen state"Bob Copeland1-7/+0
This reverts commit 2ae70efcea7a695a62bb47170d3fb16674b8dbea. The new peer events that are generated by the change are causing problems with wpa_supplicant in userspace: wpa_s tries to restart SAE authentication with the peer when receiving the event, even though authentication may be in progress already, and it gets very confused. Revert back to the original operating mode, which is to only get events when there is no corresponding station entry. Cc: Nishikawa, Kenzoh <[email protected]> Cc: Masashi Honma <[email protected]> Signed-off-by: Bob Copeland <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2015-01-23mac80211: complete scan work immediately if quiesced or suspendedLuciano Coelho1-0/+5
It is possible that a deferred scan is queued after the queues are flushed in __ieee80211_suspend(). The deferred scan work may be scheduled by ROC or ieee80211_stop_poll(). To make sure don't start a new scan while suspending, check whether we're quiescing or suspended and complete the scan immediately if that's the case. Signed-off-by: Luciano Coelho <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2015-01-23mac80211: avoid races related to suspend flowEmmanuel Grumbach3-12/+40
When we go to suspend, there is complex set of states that avoids races. The quiescing variable is set whlie __ieee80211_suspend is running. Then suspended is set. The code makes sure there is no window without any of these flags. The problem is that workers can still be enqueued while we are quiescing. This leads to situations where the driver is already suspending and other flows like disassociation are handled by a worker. To fix this, we need to check quiescing and suspended flags in the worker itself and not only before enqueueing it. I also add here extensive documentation to ease the understanding of these complex issues. Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2015-01-23mac80211: synchronize_net() before flushing the queuesEmmanuel Grumbach1-0/+3
When mac80211 disconnects, it drops all the packets on the queues. This happens after the net stack has been notified that we have no link anymore (netif_carrier_off). netif_carrier_off ensures that no new packets are sent to xmit() callback, but we might have older packets in the middle of the Tx path. These packets will land in the driver's queues after the latter have been flushed. Synchronize_net() between netif_carrier_off and drv_flush() will fix this. Note that we can't call synchronize_net inside ieee80211_flush_queues since there are flows that call ieee80211_flush_queues and don't need synchronize_net() which is an expensive operation. Signed-off-by: Emmanuel Grumbach <[email protected]> [reword comment to be more accurate] Signed-off-by: Johannes Berg <[email protected]>
2015-01-23mac80211: properly set CCK flag in radiotapMathy Vanhoef1-1/+1
Fix a regression introduced by commit a5e70697d0c4 ("mac80211: add radiotap flag and handling for 5/10 MHz") where the IEEE80211_CHAN_CCK channel type flag was incorrectly replaced by the IEEE80211_CHAN_OFDM flag. This commit fixes that by using the CCK flag again. Cc: [email protected] Fixes: a5e70697d0c4 ("mac80211: add radiotap flag and handling for 5/10 MHz") Signed-off-by: Mathy Vanhoef <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2015-01-23mac80211: correct header length calculationFred Chou1-0/+6
HT Control field may also be present in management frames, as defined in 8.2.4.1.10 of 802.11-2012. Account for this in calculation of header length. Signed-off-by: Fred Chou <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2015-01-23mac80211: only roll back station states for WDS when suspendingLuciano Coelho1-14/+15
In normal cases (i.e. when we are fully associated), cfg80211 takes care of removing all the stations before calling suspend in mac80211. But in the corner case when we suspend during authentication or association, mac80211 needs to roll back the station states. But we shouldn't roll back the station states in the suspend function, because this is taken care of in other parts of the code, except for WDS interfaces. For AP types of interfaces, cfg80211 takes care of disconnecting all stations before calling the driver's suspend code. For station interfaces, this is done in the quiesce code. For WDS interfaces we still need to do it here, so move the code into a new switch case for WDS. Cc: [email protected] [3.15+] Signed-off-by: Luciano Coelho <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2015-01-23nl80211: add an attribute to allow delaying the first scheduled scan cycleLuciano Coelho1-0/+5
The userspace may want to delay the the first scheduled scan or net-detect cycle. Add an optional attribute to the scheduled scan configuration to pass the delay to be (optionally) used by the driver. Signed-off-by: Luciano Coelho <[email protected]> [add the attribute to the policy to validate it] Signed-off-by: Johannes Berg <[email protected]>
2015-01-23mac80211: enable TPC through mac80211 stackLorenzo Bianconi4-8/+23
Control per packet Transmit Power Control (TPC) in lower drivers according to TX power settings configured by the user. In particular TPC is enabled if value passed in enum nl80211_tx_power_setting is NL80211_TX_POWER_LIMITED (allow using less than specified from userspace), whereas TPC is disabled if nl80211_tx_power_setting is set to NL80211_TX_POWER_FIXED (use value configured from userspace) Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2015-01-23nl80211: Allow set network namespace by fdVadim Kochan2-5/+12
Added new NL80211_ATTR_NETNS_FD which allows to set namespace via nl80211 by fd. Signed-off-by: Vadim Kochan <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2015-01-22mac80211: allow drivers to control software cryptoJohannes Berg2-29/+46
Some drivers unfortunately cannot support software crypto, but mac80211 currently assumes that they do. This has the issue that if the hardware enabling fails for some reason, the software fallback is used, which won't work. This clearly isn't desirable, the error should be reported and the key setting refused. Support this in mac80211 by allowing drivers to set a new HW flag IEEE80211_HW_SW_CRYPTO_CONTROL, in which case mac80211 will only allow software fallback if the set_key() method returns 1. The driver will also need to advertise supported cipher suites so that mac80211 doesn't advertise any (future) software ciphers that the driver can't actually do. While at it, to make it easier to support this, refactor the ieee80211_init_cipher_suites() code. Signed-off-by: Johannes Berg <[email protected]>
2015-01-22Bluetooth: Require SSP enabling before BR/EDR Secure ConnectionsMarcel Holtmann1-0/+5
When BR/EDR is supported by a controller, then it is required to enable Secure Simple Pairing first before enabling the Secure Connections feature. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2015-01-22Bluetooth: Limit BR/EDR switching for LE only with secure connectionsMarcel Holtmann1-1/+8
When a powered on dual-mode controller has been configured to operate as LE only with secure connections, then the BR/EDR side of things can not be switched back on. Do reconfigure the controller it first needs to be powered down. The secure connections feature is implemented in the BR/EDR controller while for LE it is implemented in the host. So explicitly forbid such a transaction to avoid inconsistent states. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2015-01-22Bluetooth: Fix dependency for BR/EDR Secure Connections mode on SSPMarcel Holtmann2-7/+12
The BR/EDR Secure Connections feature should only be enabled when the Secure Simple Pairing mode has been enabled first. However since secure connections is feature that is valid for BR/EDR and LE, this needs special handling. When enabling secure connections on a LE only configured controller, thent the BR/EDR side should not be enabled in the controller. This patches makes the BR/EDR Secure Connections feature depending on enabling Secure Simple Pairing mode first. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2015-01-22Bluetooth: Fix reporting invalid RSSI for LE devicesSzymon Janc1-1/+2
Start Discovery was reporting 0 RSSI for invalid RSSI only for BR/EDR devices. LE devices were reported with RSSI 127. Signed-off-by: Szymon Janc <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]> Cc: [email protected] # 3.19+
2015-01-21mac80211: fix HW registration error pathsJohannes Berg1-6/+6
Station info state is started in allocation, so should be destroyed on free (it's just a timer); rate control must be freed if anything afterwards fails to initialize. LED exit should be later, no need for locking there, but it needs to be done also when rate init failed. Also clean up the code by moving a label so the locking doesn't have to be done separately. Signed-off-by: Johannes Berg <[email protected]>
2015-01-21virtio/9p: verify device has config spaceMichael S. Tsirkin1-0/+6
Some devices might not implement config space access (e.g. remoteproc used not to - before 3.9). virtio/9p needs config space access so make it fail gracefully if not there. Signed-off-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2015-01-19Merge tag 'mac80211-next-for-davem-2015-01-19' of ↵David S. Miller8-57/+98
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Some further updates for net-next: * fix network-manager which was broken by the previous changes * fix delete-station events, which were broken by me making the genlmsg_end() mistake * fix a timer left running during suspend in some race conditions that would cause an annoying (but harmless) warning * (less important, but in the tree already) remove 80+80 MHz rate reporting since the spec doesn't distinguish it from 160 MHz; as the bitrate they're both 160 MHz bandwidth Signed-off-by: David S. Miller <[email protected]>
2015-01-19phonet netlink: allow multiple messages per skb in route dumpJohannes Berg1-15/+7
My previous patch to this file changed the code to be bug-compatible towards userspace. Unless userspace (which I wasn't able to find) implements the dump reader by hand in a wrong way, this isn't needed. If it uses libnl or similar code putting multiple messages into a single SKB is far more efficient. Change the code to do this. While at it, also clean it up and don't use so many variables - just store the address in the callback args directly. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-19net: sched: Introduce connmark actionFelix Fietkau3-0/+204
This tc action allows you to retrieve the connection tracking mark This action has been used heavily by openwrt for a few years now. There are known limitations currently: doesn't work for initial packets, since we only query the ct table. Fine given use case is for returning packets no implicit defrag. frags should be rare so fix later.. won't work for more complex tasks, e.g. lookup of other extensions since we have no means to store results we still have a 2nd lookup later on via normal conntrack path. This shouldn't break anything though since skb->nfct isn't altered. V2: remove unnecessary braces (Jiri) change the action identifier to 14 (Jiri) Fix some stylistic issues caught by checkpatch V3: Move module params to bottom (Cong) Get rid of tcf_hashinfo_init and friends and conform to newer API (Cong) Acked-by: Jiri Pirko <[email protected]> Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2015-01-19net: bridge: reject DSA-enabled master netdevices as bridge membersFlorian Fainelli1-2/+8
DSA-enabled master network devices with a switch tagging protocol should strip the protocol specific format before handing the frame over to higher layer. When adding such a DSA master network device as a bridge member, we go through the following code path when receiving a frame: __netif_receive_skb_core -> first ptype check against ptype_all is not returning any handler for this skb -> check and invoke rx_handler: -> deliver frame to the bridge layer: br_handle_frame DSA registers a ptype handler with the fake ETH_XDSA ethertype, which is called *after* the bridge-layer rx_handler has run. br_handle_frame() tries to parse the frame it received from the DSA master network device, and will not be able to match any of its conditions and jumps straight at the end of the end of br_handle_frame() and returns RX_HANDLER_CONSUMED there. Since we returned RX_HANDLER_CONSUMED, __netif_receive_skb_core() stops RX processing for this frame and returns NET_RX_SUCCESS, so we never get a chance to call our switch tag packet processing logic and deliver frames to the DSA slave network devices, and so we do not get any functional bridge members at all. Instead of cluttering the bridge receive path with DSA-specific checks, and rely on assumptions about how __netif_receive_skb_core() is processing frames, we simply deny adding the DSA master network device (conduit interface) as a bridge member, leaving only the slave DSA network devices to be bridge members, since those will work correctly in all circumstances. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>