Linux 3.16.6
Greg KH
maintainerI'm announcing the release of the 3.16.6 kernel.
All users of the 3.16 kernel series must upgrade.
The updated 3.16.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.16.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/kernel-parameters.txt | 4 + Makefile | 2 drivers/base/node.c | 1 drivers/crypto/caam/caamhash.c | 6 - drivers/net/bonding/bond_main.c | 17 +++- drivers/net/ethernet/broadcom/bcmsysport.c | 13 +-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 92 ++++------------------- drivers/net/ethernet/broadcom/tg3.c | 23 +++++ drivers/net/ethernet/cadence/macb.c | 11 -- drivers/net/ethernet/mellanox/mlx4/cmd.c | 21 +++++ drivers/net/ethernet/mellanox/mlx4/main.c | 4 - drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 88 ++++++++++++++-------- drivers/net/hyperv/netvsc.c | 15 ++- drivers/net/hyperv/netvsc_drv.c | 3 drivers/net/macvlan.c | 16 ++-- drivers/net/macvtap.c | 18 ++-- drivers/net/phy/smsc.c | 33 +++++--- drivers/net/team/team.c | 4 - drivers/net/vxlan.c | 8 +- drivers/tty/serial/8250/8250_pci.c | 21 +++++ drivers/usb/core/hub.c | 6 + drivers/usb/core/quirks.c | 4 + drivers/usb/musb/musb_dsps.c | 2 drivers/usb/serial/cp210x.c | 2 drivers/usb/storage/uas.c | 17 ++++ drivers/usb/storage/unusual_uas.h | 45 ++++++++--- drivers/usb/storage/usb.c | 9 ++ include/linux/if_vlan.h | 6 - include/linux/skbuff.h | 1 include/linux/usb/quirks.h | 3 include/linux/usb_usual.h | 4 + include/net/dst.h | 16 +++- include/net/inet_connection_sock.h | 1 include/net/ip6_fib.h | 5 - include/net/net_namespace.h | 20 ----- include/net/sctp/command.h | 2 include/net/sock.h | 1 include/net/tcp.h | 5 + net/8021q/vlan_core.c | 53 ------------- net/bridge/br_private.h | 3 net/bridge/br_vlan.c | 14 ++- net/core/dev.c | 18 +++- net/core/filter.c | 1 net/core/rtnetlink.c | 3 net/core/skbuff.c | 56 ++++++++++++++ net/ipv4/ip_tunnel.c | 11 ++ net/ipv4/route.c | 6 - net/ipv4/tcp.c | 14 +-- net/ipv4/tcp_input.c | 8 -- net/ipv4/tcp_ipv4.c | 5 - net/ipv4/tcp_output.c | 7 + net/ipv6/addrconf.c | 18 +--- net/ipv6/addrconf_core.c | 7 + net/ipv6/anycast.c | 10 ++ net/ipv6/ip6_fib.c | 22 +++++ net/ipv6/ip6_gre.c | 4 - net/ipv6/ip6_output.c | 4 - net/ipv6/mcast.c | 14 +++ net/ipv6/route.c | 4 - net/ipv6/sit.c | 6 - net/ipv6/tcp_ipv6.c | 3 net/l2tp/l2tp_ppp.c | 3 net/netlink/af_netlink.c | 2 net/openvswitch/actions.c | 5 + net/packet/af_packet.c | 17 ++++ net/packet/internal.h | 1 net/sched/cls_api.c | 1 net/sctp/sm_statefuns.c | 19 ++++ net/tipc/port.h | 5 + net/tipc/socket.c | 2 net/xfrm/xfrm_policy.c | 48 ++++++++++-- 71 files changed, 597 insertions(+), 346 deletions(-)
Andreas Bomholtz (1):
USB: cp210x: add support for Seluxit USB dongle
Andrey Vagin (1):
tcp: don't use timestamp from repaired skb-s to calculate RTT (v2)
Benjamin Block (1):
net: ipv6: fib: don't sleep inside atomic lock
Bryan O'Donoghue (1):
serial: 8250: Add Quark X1000 to 8250_pci.c
Cristian Stoica (1):
crypto: caam - fix addressing of struct member
Daniel Borkmann (1):
netlink: reset network header before passing to taps
David S. Miller (1):
Revert "macvlan: simplify the structure port"
Eric Dumazet (3):
packet: handle too big packets for PACKET_V3
net: filter: fix possible use after free
gro: fix aggregation for skb using frag_list
Erik Hugne (1):
tipc: fix message importance range check
Felipe Balbi (1):
usb: musb: dsps: kill OTG timer on suspend
Florian Fainelli (1):
net: systemport: fix bcm_sysport_insert_tsb()
Francesco Ruggeri (1):
net: allow macvlans to move to net namespace
Gerhard Stenzel (1):
vxlan: fix incorrect initializer in union vxlan_addr
Greg Kroah-Hartman (1):
Linux 3.16.6
Guillaume Nault (1):
l2tp: fix race while getting PMTU on PPP pseudo-wire
Gwenhael Goavec-Merou (1):
net: phy: smsc: move smsc_phy_config_init reset part in a soft_reset function
Hannes Frederic Sowa (1):
ipv6: remove rt6i_genid
Hans de Goede (4):
uas: Add a quirk for rejecting ATA_12 and ATA_16 commands
uas: Add no-report-opcodes quirk
uas: Add US_FL_NO_ATA_1X quirk for Seagate (0bc2:ab20) drives
uas: Add another ASM1051 usb-id to the uas blacklist
Jiri Benc (2):
rtnetlink: fix VF info size
openvswitch: fix panic with multiple vlan headers
Joe Lawrence (1):
team: avoid race condition in scheduling delayed work
Joe Savage (1):
USB: serial: cp210x: added Ketra N1 wireless interface support
KY Srinivasan (2):
hyperv: Fix a bug in netvsc_start_xmit()
hyperv: Fix a bug in netvsc_send()
Lu Baolu (1):
USB: Add device quirk for ASUS T100 Base Station keyboard
Matan Barak (2):
net/mlx4_core: Allow not to specify probe_vf in SRIOV IB mode net/mlx4: Correctly configure single ported VFs from the host
Michal Kubeček (1):
net: fix checksum features handling in netif_skb_features()
Neal Cardwell (2):
tcp: fix tcp_release_cb() to dispatch via address family for mtu_reduced()
tcp: fix ssthresh and undo for consecutive short FRTO episodes
Nicolas Dichtel (2):
macvlan: allow to enqueue broadcast pkt on virtual device
ip6_gre: fix flowi6_proto value in xmit path
Nikolay Aleksandrov (1):
bonding: fix div by zero while enslaving and transmitting
Sabrina Dubroca (1):
ipv6: fix rtnl locking in setsockopt for anycast and multicast
Shmulik Ladkani (1):
sit: Fix ipip6_tunnel_lookup device matching criteria
Soren Brinkmann (1):
Revert "net/macb: add pinctrl consumer support"
Stanislaw Gruszka (1):
myri10ge: check for DMA mapping errors
Steffen Klassert (3):
xfrm: Generate blackhole routes only from route lookup functions
xfrm: Generate queueing routes only from route lookup functions
ip_tunnel: Don't allow to add the same tunnel multiple times.
Vlad Yasevich (7):
net: Always untag vlan-tagged traffic on input.
bridge: Check if vlan filtering is enabled only once.
bridge: Fix br_should_learn to check vlan_enabled
tg3: Work around HW/FW limitations with vlan encapsulated frames
tg3: Allow for recieve of full-size 8021AD frames
macvtap: Fix race between device delete and open.
sctp: handle association restarts when the socket is closed.
WANG Cong (2):
ipv6: restore the behavior of ipv6_sock_ac_drop()
net_sched: copy exts->type in tcf_exts_change()
Yasuaki Ishimatsu (1):
driver/base/node: remove unnecessary kfree of node struct from unregister_one_node
Yuval Mintz (1):
bnx2x: Revert UNDI flushing mechanism
Greg KH
maintainerDocumentation/kernel-parameters.txt +4 -0
@@ -3459,6 +3459,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. READ_DISC_INFO command); e = NO_READ_CAPACITY_16 (don't use READ_CAPACITY_16 command); + f = NO_REPORT_OPCODES (don't use report opcodes + command, uas only); h = CAPACITY_HEURISTICS (decrease the reported device capacity by one sector if the number is odd);
@@ -3478,6 +3480,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. bogus residue values); s = SINGLE_LUN (the device has only one Logical Unit); + t = NO_ATA_1X (don't allow ATA(12) and ATA(16) + commands, uas only); u = IGNORE_UAS (don't bind to the uas driver); w = NO_WP_DETECT (don't test whether the medium is write-protected).
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 16 -SUBLEVEL = 5 +SUBLEVEL = 6 EXTRAVERSION = NAME = Museum of Fishiegoodies
drivers/base/node.c +0 -1
@@ -603,7 +603,6 @@ void unregister_one_node(int nid)return ;unregister_node (node_devices[nid]); -kfree (node_devices[nid]); node_devices[nid] =NULL ; }
drivers/crypto/caam/caamhash.c +3 -3
@@ -1338,9 +1338,9 @@ static int ahash_update_first(struct ahash_request *req)struct device *jrdev = ctx->jrdev;gfp_t flags = (req->base.flags & (CRYPTO_TFM_REQ_MAY_BACKLOG |CRYPTO_TFM_REQ_MAY_SLEEP )) ?GFP_KERNEL :GFP_ATOMIC ; -u8 *next_buf = state->buf_0 + state->current_buf * -CAAM_MAX_HASH_BLOCK_SIZE ; -int *next_buflen = &state->buflen_0 + state->current_buf; +u8 *next_buf = state->current_buf ? state->buf_1 : state->buf_0; +int *next_buflen = state->current_buf ? + &state->buflen_1 : &state->buflen_0;int to_hash;u32 *sh_desc = ctx->sh_desc_update_first, *desc;dma_addr_t ptr = ctx->sh_desc_update_first_dma;
drivers/net/bonding/bond_main.c +14 -3
@@ -3667,8 +3667,14 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_develse bond_xmit_slave_id (bond, skb,0 ); }else { - slave_id =bond_rr_gen_slave_id (bond); -bond_xmit_slave_id (bond, skb, slave_id % bond->slave_cnt); +int slave_cnt =ACCESS_ONCE (bond->slave_cnt); + +if (likely (slave_cnt)) { + slave_id =bond_rr_gen_slave_id (bond); +bond_xmit_slave_id (bond, skb, slave_id % slave_cnt); + }else { +dev_kfree_skb_any (skb); + } }return NETDEV_TX_OK ;
@@ -3699,8 +3705,13 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dstatic int bond_xmit_xor (struct sk_buff *skb,struct net_device *bond_dev) {struct bonding *bond =netdev_priv (bond_dev); +int slave_cnt =ACCESS_ONCE (bond->slave_cnt); -bond_xmit_slave_id (bond, skb,bond_xmit_hash (bond, skb) % bond->slave_cnt); +if (likely (slave_cnt)) +bond_xmit_slave_id (bond, skb, +bond_xmit_hash (bond, skb) % slave_cnt); +else +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
drivers/net/ethernet/broadcom/bcmsysport.c +7 -6
@@ -757,7 +757,8 @@ static irqreturn_t bcm_sysport_tx_isr(int irq, void *dev_id)return IRQ_HANDLED ; } -static int bcm_sysport_insert_tsb (struct sk_buff *skb,struct net_device *dev) +static struct sk_buff *bcm_sysport_insert_tsb (struct sk_buff *skb, +struct net_device *dev) {struct sk_buff *nskb;struct bcm_tsb *tsb;
@@ -773,7 +774,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev)if (!nskb) { dev->stats.tx_errors++; dev->stats.tx_dropped++; -return -ENOMEM ; +return NULL ; } skb = nskb; }
@@ -792,7 +793,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev) ip_proto =ipv6_hdr (skb)->nexthdr;break ;default : -return 0 ; +return skb; }/* Get the checksum offset and the L4 (transport) offset */
@@ -810,7 +811,7 @@ static int bcm_sysport_insert_tsb(struct sk_buff *skb, struct net_device *dev) tsb->l4_ptr_dest_map = csum_info; } -return 0 ; +return skb; } static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
@@ -844,8 +845,8 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,/* Insert TSB and checksum infos */ if (priv->tsb_en) { - ret =bcm_sysport_insert_tsb (skb, dev); -if (ret) { + skb =bcm_sysport_insert_tsb (skb, dev); +if (!skb) { ret =NETDEV_TX_OK ; goto out; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +17 -75
130 lines not on this page · raw message
drivers/net/ethernet/broadcom/tg3.c +20 -3
@@ -6918,7 +6918,8 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) skb->protocol =eth_type_trans (skb, tp->dev);if (len > (tp->dev->mtu +ETH_HLEN ) && - skb->protocol !=htons (ETH_P_8021Q )) { + skb->protocol !=htons (ETH_P_8021Q ) && + skb->protocol !=htons (ETH_P_8021AD )) {dev_kfree_skb_any (skb); goto drop_it_no_recycle; }
@@ -7914,8 +7915,6 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) entry = tnapi->tx_prod; base_flags =0 ; -if (skb->ip_summed ==CHECKSUM_PARTIAL ) - base_flags |=TXD_FLAG_TCPUDP_CSUM ; mss =skb_shinfo (skb)->gso_size;if (mss) {
@@ -7929,6 +7928,13 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) hdr_len =skb_transport_offset (skb) +tcp_hdrlen (skb) -ETH_HLEN ; +/* HW/FW can not correctly segment packets that have been +* vlan encapsulated. +*/ +if (skb->protocol ==htons (ETH_P_8021Q ) || + skb->protocol ==htons (ETH_P_8021AD )) +return tg3_tso_bug (tp, tnapi, txq, skb); +if (!skb_is_gso_v6 (skb)) {if (unlikely ((ETH_HLEN + hdr_len) >80 ) &&tg3_flag (tp,TSO_BUG ))
@@ -7979,6 +7985,17 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) base_flags |= tsflags <<12 ; } } + }else if (skb->ip_summed ==CHECKSUM_PARTIAL ) { +/* HW/FW can not correctly checksum packets that have been +* vlan encapsulated. +*/ +if (skb->protocol ==htons (ETH_P_8021Q ) || + skb->protocol ==htons (ETH_P_8021AD )) { +if (skb_checksum_help (skb)) + goto drop; + }else { + base_flags |=TXD_FLAG_TCPUDP_CSUM ; + } } if (tg3_flag(tp, USE_JUMBO_BDFLAG) &&
drivers/net/ethernet/cadence/macb.c +0 -11
@@ -30,7 +30,6 @@#include <linux/of_device.h> #include <linux/of_mdio.h> #include <linux/of_net.h> -#include <linux/pinctrl/consumer.h> #include "macb.h"
@@ -1803,7 +1802,6 @@ static int __init macb_probe(struct platform_device *pdev)struct phy_device *phydev;u32 config;int err = -ENXIO ; -struct pinctrl *pinctrl;const char *mac; regs =platform_get_resource (pdev,IORESOURCE_MEM ,0 );
@@ -1812,15 +1810,6 @@ static int __init macb_probe(struct platform_device *pdev) goto err_out; } - pinctrl =devm_pinctrl_get_select_default (&pdev->dev); -if (IS_ERR (pinctrl)) { - err =PTR_ERR (pinctrl); -if (err == -EPROBE_DEFER ) - goto err_out; - -dev_warn (&pdev->dev,"No pinctrl provided\n" ); - } - err = -ENOMEM ; dev =alloc_etherdev (sizeof (*bp));if (!dev)
drivers/net/ethernet/mellanox/mlx4/cmd.c +21 -0
@@ -2380,6 +2380,22 @@ struct mlx4_slaves_pport mlx4_phys_to_slaves_pport_actv( }EXPORT_SYMBOL_GPL (mlx4_phys_to_slaves_pport_actv); +static int mlx4_slaves_closest_port (struct mlx4_dev *dev,int slave,int port) +{ +struct mlx4_active_ports actv_ports =mlx4_get_active_ports (dev, slave); +int min_port =find_first_bit (actv_ports.ports, dev->caps.num_ports) + +1 ; +int max_port = min_port + +bitmap_weight (actv_ports.ports, dev->caps.num_ports); + +if (port < min_port) + port = min_port; +else if (port >= max_port) + port = max_port -1 ; + +return port; +} +int mlx4_set_vf_mac (struct mlx4_dev *dev,int port,int vf,u64 mac) {struct mlx4_priv *priv =mlx4_priv (dev);
@@ -2393,6 +2409,7 @@ int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac)if (slave <0 )return -EINVAL ; + port =mlx4_slaves_closest_port (dev, slave, port); s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; s_info->mac = mac; mlx4_info(dev, "default mac on vf %d port %d to %llX will take afect only after vf restart\n",
@@ -2419,6 +2436,7 @@ int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos)if (slave <0 )return -EINVAL ; + port =mlx4_slaves_closest_port (dev, slave, port); vf_admin = &priv->mfunc.master.vf_admin[slave].vport[port];if ((0 == vlan) && (0 == qos))
@@ -2446,6 +2464,7 @@ bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave,struct mlx4_priv *priv; priv =mlx4_priv (dev); + port =mlx4_slaves_closest_port (dev, slave, port); vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port];if (MLX4_VGT != vp_oper->state.default_vlan) {
@@ -2473,6 +2492,7 @@ int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting)if (slave <0 )return -EINVAL ; + port =mlx4_slaves_closest_port (dev, slave, port); s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; s_info->spoofchk = setting;
@@ -2526,6 +2546,7 @@ int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_statif (slave <0 )return -EINVAL ; + port =mlx4_slaves_closest_port (dev, slave, port);switch (link_state) {case IFLA_VF_LINK_STATE_AUTO :/* get current link state */
drivers/net/ethernet/mellanox/mlx4/main.c +2 -2
@@ -78,13 +78,13 @@ MODULE_PARM_DESC(msi_x, "attempt to use MSI-X if nonzero");#endif /* CONFIG_PCI_MSI */ static uint8_t num_vfs[3 ] = {0 ,0 ,0 }; -static int num_vfs_argc =3 ; +static int num_vfs_argc;module_param_array (num_vfs, byte , &num_vfs_argc,0444 );MODULE_PARM_DESC (num_vfs,"enable #num_vfs functions if num_vfs > 0\n" "num_vfs=port1,port2,port1+2" );static uint8_t probe_vf[3 ] = {0 ,0 ,0 }; -static int probe_vfs_argc =3 ; +static int probe_vfs_argc;module_param_array (probe_vf, byte, &probe_vfs_argc,0444 );MODULE_PARM_DESC (probe_vf,"number of vfs to probe by pf driver (num_vfs > 0)\n" "probe_vf=port1,port2,port1+2" );
drivers/net/ethernet/myricom/myri10ge/myri10ge.c +58 -30
146 lines not on this page · raw message
drivers/net/hyperv/netvsc.c +8 -7
@@ -708,6 +708,7 @@ int netvsc_send(struct hv_device *device,unsigned int section_index =NETVSC_INVALID_INDEX ;u32 msg_size =0 ;struct sk_buff *skb; +u16 q_idx = packet->q_idx; net_device =get_outbound_net_device (device);
@@ -772,24 +773,24 @@ int netvsc_send(struct hv_device *device,if (ret ==0 ) {atomic_inc (&net_device->num_outstanding_sends); -atomic_inc (&net_device->queue_sends[packet->q_idx]); +atomic_inc (&net_device->queue_sends[q_idx]);if (hv_ringbuf_avail_percent (&out_channel->outbound) <RING_AVAIL_PERCENT_LOWATER ) {netif_tx_stop_queue (netdev_get_tx_queue ( - ndev, packet->q_idx)); + ndev, q_idx));if (atomic_read (&net_device-> - queue_sends[packet->q_idx]) <1 ) + queue_sends[q_idx]) <1 )netif_tx_wake_queue (netdev_get_tx_queue ( - ndev, packet->q_idx)); + ndev, q_idx)); } }else if (ret == -EAGAIN ) {netif_tx_stop_queue (netdev_get_tx_queue ( - ndev, packet->q_idx)); -if (atomic_read (&net_device->queue_sends[packet->q_idx]) <1 ) { + ndev, q_idx)); +if (atomic_read (&net_device->queue_sends[q_idx]) <1 ) {netif_tx_wake_queue (netdev_get_tx_queue ( - ndev, packet->q_idx)); + ndev, q_idx)); ret = -ENOSPC ; } }else {
drivers/net/hyperv/netvsc_drv.c +2 -1
@@ -387,6 +387,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)int hdr_offset;u32 net_trans_info;u32 hash; +u32 skb_length = skb->len;/* We will atmost need two pages to describe the rndis
@@ -562,7 +563,7 @@ do_send: drop:if (ret ==0 ) { - net->stats.tx_bytes += skb->len; + net->stats.tx_bytes += skb_length; net->stats.tx_packets++; }else {kfree (packet);
drivers/net/macvlan.c +10 -6
@@ -36,6 +36,7 @@#include <linux/netpoll.h> #define MACVLAN_HASH_SIZE (1 << BITS_PER_BYTE) +#define MACVLAN_BC_QUEUE_LEN 1000struct macvlan_port {struct net_device *dev;
@@ -45,10 +46,9 @@ struct macvlan_port {struct sk_buff_head bc_queue;struct work_struct bc_work;bool passthru; +int count; }; -#define MACVLAN_PORT_IS_EMPTY (port) list_empty(&port->vlans) -struct macvlan_skb_cb {const struct macvlan_dev *src; };
@@ -249,7 +249,7 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port, goto err;spin_lock (&port->bc_queue.lock); -if (skb_queue_len (&port->bc_queue) < skb->dev->tx_queue_len) { +if (skb_queue_len (&port->bc_queue) <MACVLAN_BC_QUEUE_LEN ) {__skb_queue_tail (&port->bc_queue, nskb); err =0 ; }
@@ -667,7 +667,8 @@ static void macvlan_uninit(struct net_device *dev)free_percpu (vlan->pcpu_stats); -if (MACVLAN_PORT_IS_EMPTY (port)) + port->count -=1 ; +if (!port->count)macvlan_port_destroy (port->dev); }
@@ -800,6 +801,7 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev, features, mask); features |=ALWAYS_ON_FEATURES ; + features &= ~NETIF_F_NETNS_LOCAL ;return features; }
@@ -1020,12 +1022,13 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev, vlan->flags =nla_get_u16 (data[IFLA_MACVLAN_FLAGS ]);if (vlan->mode ==MACVLAN_MODE_PASSTHRU ) { -if (!MACVLAN_PORT_IS_EMPTY (port)) +if (port->count)return -EINVAL ; port->passthru = true;eth_hw_addr_inherit (dev, lowerdev); } + port->count +=1 ; err =register_netdevice (dev);if (err <0 ) goto destroy_port;
@@ -1043,7 +1046,8 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev, unregister_netdev:unregister_netdevice (dev); destroy_port: -if (MACVLAN_PORT_IS_EMPTY (port)) + port->count -=1 ; +if (!port->count)macvlan_port_destroy (lowerdev);return err;
drivers/net/macvtap.c +8 -10
@@ -112,17 +112,15 @@ out:return err; } +/* Requires RTNL */ static int macvtap_set_queue (struct net_device *dev,struct file *file,struct macvtap_queue *q) {struct macvlan_dev *vlan =netdev_priv (dev); -int err = -EBUSY ; -rtnl_lock ();if (vlan->numqueues ==MAX_MACVTAP_QUEUES ) - goto out; +return -EBUSY ; - err =0 ;rcu_assign_pointer (q->vlan, vlan);rcu_assign_pointer (vlan->taps[vlan->numvtaps], q);sock_hold (&q->sk);
@@ -136,9 +134,7 @@ static int macvtap_set_queue(struct net_device *dev, struct file *file, vlan->numvtaps++; vlan->numqueues++; -out: -rtnl_unlock (); -return err; +return 0 ; }static int macvtap_disable_queue (struct macvtap_queue *q)
@@ -454,11 +450,12 @@ static void macvtap_sock_destruct(struct sock *sk)static int macvtap_open (struct inode *inode,struct file *file) {struct net *net = current->nsproxy->net_ns; -struct net_device *dev =dev_get_by_macvtap_minor (iminor (inode)); +struct net_device *dev;struct macvtap_queue *q; -int err; +int err = -ENODEV ; - err = -ENODEV ; +rtnl_lock (); + dev =dev_get_by_macvtap_minor (iminor (inode));if (!dev) goto out;
@@ -498,6 +495,7 @@ out:if (dev)dev_put (dev); +rtnl_unlock ();return err; }
drivers/net/phy/smsc.c +21 -12
@@ -43,6 +43,22 @@ static int smsc_phy_ack_interrupt(struct phy_device *phydev)static int smsc_phy_config_init (struct phy_device *phydev) { +int rc =phy_read (phydev,MII_LAN83C185_CTRL_STATUS ); + +if (rc <0 ) +return rc; + +/* Enable energy detect mode for this SMSC Transceivers */ + rc =phy_write (phydev,MII_LAN83C185_CTRL_STATUS , + rc |MII_LAN83C185_EDPWRDOWN ); +if (rc <0 ) +return rc; + +return smsc_phy_ack_interrupt (phydev); +} + +static int smsc_phy_reset (struct phy_device *phydev) +{int rc =phy_read (phydev,MII_LAN83C185_SPECIAL_MODES );if (rc <0 )return rc;
@@ -66,18 +82,7 @@ static int smsc_phy_config_init(struct phy_device *phydev) rc =phy_read (phydev,MII_BMCR ); }while (rc &BMCR_RESET ); } - - rc =phy_read (phydev,MII_LAN83C185_CTRL_STATUS ); -if (rc <0 ) -return rc; - -/* Enable energy detect mode for this SMSC Transceivers */ - rc =phy_write (phydev,MII_LAN83C185_CTRL_STATUS , - rc |MII_LAN83C185_EDPWRDOWN ); -if (rc <0 ) -return rc; - -return smsc_phy_ack_interrupt (phydev); +return 0 ; }static int lan911x_config_init (struct phy_device *phydev)
@@ -142,6 +147,7 @@ static struct phy_driver smsc_phy_driver[] = { .config_aneg = genphy_config_aneg, .read_status = genphy_read_status, .config_init = smsc_phy_config_init, + .soft_reset = smsc_phy_reset,/* IRQ related */ .ack_interrupt = smsc_phy_ack_interrupt,
@@ -164,6 +170,7 @@ static struct phy_driver smsc_phy_driver[] = { .config_aneg = genphy_config_aneg, .read_status = genphy_read_status, .config_init = smsc_phy_config_init, + .soft_reset = smsc_phy_reset,/* IRQ related */ .ack_interrupt = smsc_phy_ack_interrupt,
@@ -186,6 +193,7 @@ static struct phy_driver smsc_phy_driver[] = { .config_aneg = genphy_config_aneg, .read_status = genphy_read_status, .config_init = smsc_phy_config_init, + .soft_reset = smsc_phy_reset,/* IRQ related */ .ack_interrupt = smsc_phy_ack_interrupt,
@@ -230,6 +238,7 @@ static struct phy_driver smsc_phy_driver[] = { .config_aneg = genphy_config_aneg, .read_status = lan87xx_read_status, .config_init = smsc_phy_config_init, + .soft_reset = smsc_phy_reset,/* IRQ related */ .ack_interrupt = smsc_phy_ack_interrupt,
drivers/net/team/team.c +2 -2
@@ -647,7 +647,7 @@ static void team_notify_peers(struct team *team) {if (!team->notify_peers.count || !netif_running (team->dev))return ; -atomic_set (&team->notify_peers.count_pending, team->notify_peers.count); +atomic_add (team->notify_peers.count, &team->notify_peers.count_pending);schedule_delayed_work (&team->notify_peers.dw,0 ); }
@@ -687,7 +687,7 @@ static void team_mcast_rejoin(struct team *team) {if (!team->mcast_rejoin.count || !netif_running (team->dev))return ; -atomic_set (&team->mcast_rejoin.count_pending, team->mcast_rejoin.count); +atomic_add (team->mcast_rejoin.count, &team->mcast_rejoin.count_pending);schedule_delayed_work (&team->mcast_rejoin.dw,0 ); }
drivers/net/vxlan.c +4 -4
@@ -1325,7 +1325,7 @@ static int arp_reduce(struct net_device *dev, struct sk_buff *skb) }else if (vxlan->flags &VXLAN_F_L3MISS ) {union vxlan_addr ipa = { .sin.sin_addr.s_addr = tip, - .sa.sa_family =AF_INET , + .sin.sin_family =AF_INET , };vxlan_ip_miss (dev, &ipa);
@@ -1486,7 +1486,7 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb) }else if (vxlan->flags &VXLAN_F_L3MISS ) {union vxlan_addr ipa = { .sin6.sin6_addr = msg->target, - .sa.sa_family =AF_INET6 , + .sin6.sin6_family =AF_INET6 , };vxlan_ip_miss (dev, &ipa);
@@ -1519,7 +1519,7 @@ static bool route_shortcircuit(struct net_device *dev, struct sk_buff *skb)if (!n && (vxlan->flags &VXLAN_F_L3MISS )) {union vxlan_addr ipa = { .sin.sin_addr.s_addr = pip->daddr, - .sa.sa_family =AF_INET , + .sin.sin_family =AF_INET , };vxlan_ip_miss (dev, &ipa);
@@ -1540,7 +1540,7 @@ static bool route_shortcircuit(struct net_device *dev, struct sk_buff *skb)if (!n && (vxlan->flags &VXLAN_F_L3MISS )) {union vxlan_addr ipa = { .sin6.sin6_addr = pip6->daddr, - .sa.sa_family =AF_INET6 , + .sin6.sin6_family =AF_INET6 , };vxlan_ip_miss (dev, &ipa);
drivers/tty/serial/8250/8250_pci.c +21 -0
@@ -1790,6 +1790,7 @@ pci_wch_ch353_setup(struct serial_private *priv,#define PCI_DEVICE_ID_COMMTECH_4222PCIE 0x0022#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a#define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e +#define PCI_DEVICE_ID_INTEL_QRK_UART 0x0936#define PCI_VENDOR_ID_SUNIX 0x1fd4#define PCI_DEVICE_ID_SUNIX_1999 0x1999
@@ -1900,6 +1901,13 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { .subdevice = PCI_ANY_ID, .setup = byt_serial_setup, }, + { + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_QRK_UART, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .setup = pci_default_setup, + },/* * ITE */
@@ -2742,6 +2750,7 @@ enum pci_board_num_t { pbn_ADDIDATA_PCIe_8_3906250, pbn_ce4100_1_115200, pbn_byt, + pbn_qrk, pbn_omegapci, pbn_NETMOS9900_2s_115200, pbn_brcm_trumanage,
@@ -3492,6 +3501,12 @@ static struct pciserial_board pci_boards[] = { .uart_offset = 0x80, .reg_shift = 2, }, + [pbn_qrk] = { + .flags = FL_BASE0, + .num_ports = 1, + .base_baud = 2764800, + .reg_shift = 2, + }, [pbn_omegapci] = { .flags = FL_BASE0, .num_ports = 8,
@@ -5194,6 +5209,12 @@ static struct pci_device_id serial_pci_tbl[] = { pbn_byt },/* +* Intel Quark x1000 +*/ + {PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_QRK_UART , +PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , + pbn_qrk }, +/* * Cronyx Omega PCI */ { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
drivers/usb/core/hub.c +4 -2
@@ -1983,8 +1983,10 @@ void usb_set_device_state(struct usb_device *udev, || new_state == USB_STATE_SUSPENDED) ;/* No change to wakeup settings */ else if (new_state == USB_STATE_CONFIGURED) - wakeup = udev->actconfig->desc.bmAttributes - &USB_CONFIG_ATT_WAKEUP ; + wakeup = (udev->quirks & +USB_QUIRK_IGNORE_REMOTE_WAKEUP ) ?0 : + udev->actconfig->desc.bmAttributes & +USB_CONFIG_ATT_WAKEUP ; else wakeup =0 ; }
drivers/usb/core/quirks.c +4 -0
@@ -160,6 +160,10 @@ static const struct usb_device_id usb_interface_quirk_list[] = { { USB_VENDOR_AND_INTERFACE_INFO(0x046d, USB_CLASS_VIDEO, 1, 0), .driver_info = USB_QUIRK_RESET_RESUME }, + /* ASUS Base Station(T100) */ + { USB_DEVICE(0x0b05, 0x17e0), .driver_info = + USB_QUIRK_IGNORE_REMOTE_WAKEUP }, + { } /* terminating entry must be last */ };
drivers/usb/musb/musb_dsps.c +2 -0
@@ -780,6 +780,7 @@ static int dsps_suspend(struct device *dev)struct musb *musb =platform_get_drvdata (glue->musb);void __iomem *mbase = musb->ctrl_base; +del_timer_sync (&glue->timer); glue->context.control =dsps_readl (mbase, wrp->control); glue->context.epintr =dsps_readl (mbase, wrp->epintr_set); glue->context.coreintr =dsps_readl (mbase, wrp->coreintr_set);
@@ -805,6 +806,7 @@ static int dsps_resume(struct device *dev)dsps_writel (mbase, wrp->mode, glue->context.mode);dsps_writel (mbase, wrp->tx_mode, glue->context.tx_mode);dsps_writel (mbase, wrp->rx_mode, glue->context.rx_mode); +setup_timer (&glue->timer, otg_timer, (unsigned long ) musb);return 0 ; }
drivers/usb/serial/cp210x.c +2 -0
@@ -122,6 +122,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ + { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
@@ -155,6 +156,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ + { USB_DEVICE(0x1D6F, 0x0010) }, /* Seluxit ApS RF Dongle */ { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */ { USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */ { USB_DEVICE(0x1FB9, 0x0100) }, /* Lake Shore Model 121 Current Source */
drivers/usb/storage/uas.c +17 -0
@@ -28,6 +28,7 @@#include <scsi/scsi_tcq.h> #include "uas-detect.h" +#include "scsiglue.h" /* * The r00-r01c specs define this version of the SENSE IU data structure.
@@ -49,6 +50,7 @@ struct uas_dev_info {struct usb_anchor cmd_urbs;struct usb_anchor sense_urbs;struct usb_anchor data_urbs; +unsigned long flags;int qdepth, resetting;struct response_iu response;unsigned cmd_pipe, status_pipe, data_in_pipe, data_out_pipe;
@@ -714,6 +716,15 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,BUILD_BUG_ON (sizeof (struct uas_cmd_info ) >sizeof (struct scsi_pointer )); +if ((devinfo->flags &US_FL_NO_ATA_1X ) && + (cmnd->cmnd[0 ] ==ATA_12 || cmnd->cmnd[0 ] ==ATA_16 )) { +memcpy (cmnd->sense_buffer, usb_stor_sense_invalidCDB, +sizeof (usb_stor_sense_invalidCDB)); + cmnd->result =SAM_STAT_CHECK_CONDITION ; + cmnd->scsi_done (cmnd); +return 0 ; + } +spin_lock_irqsave (&devinfo->lock, flags);if (devinfo->resetting) {
@@ -950,6 +961,10 @@ static int uas_slave_alloc(struct scsi_device *sdev)static int uas_slave_configure (struct scsi_device *sdev) {struct uas_dev_info *devinfo = sdev->hostdata; + +if (devinfo->flags &US_FL_NO_REPORT_OPCODES ) + sdev->no_report_opcodes =1 ; +scsi_set_tag_type (sdev,MSG_ORDERED_TAG );scsi_activate_tcq (sdev, devinfo->qdepth -2 );return 0 ;
@@ -1080,6 +1095,8 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id) devinfo->resetting =0 ; devinfo->running_task =0 ; devinfo->shutdown =0 ; + devinfo->flags = id->driver_info; +usb_stor_adjust_quirks (udev, &devinfo->flags);init_usb_anchor (&devinfo->cmd_urbs);init_usb_anchor (&devinfo->sense_urbs);init_usb_anchor (&devinfo->data_urbs);
drivers/usb/storage/unusual_uas.h +35 -10
48 lines not on this page · raw message
drivers/usb/storage/usb.c +8 -1
@@ -476,7 +476,8 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags)US_FL_CAPACITY_OK |US_FL_IGNORE_RESIDUE |US_FL_SINGLE_LUN |US_FL_NO_WP_DETECT |US_FL_NO_READ_DISC_INFO |US_FL_NO_READ_CAPACITY_16 | - US_FL_INITIAL_READ10 | US_FL_WRITE_CACHE); +US_FL_INITIAL_READ10 |US_FL_WRITE_CACHE | + US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES); p = quirks;while (*p) {
@@ -514,6 +515,9 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags)case 'e' : f |=US_FL_NO_READ_CAPACITY_16 ;break ; +case 'f' : + f |=US_FL_NO_REPORT_OPCODES ; +break ;case 'h' : f |=US_FL_CAPACITY_HEURISTICS ;break ;
@@ -541,6 +545,9 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags)case 's' : f |=US_FL_SINGLE_LUN ;break ; +case 't' : + f |=US_FL_NO_ATA_1X ; +break ;case 'u' : f |=US_FL_IGNORE_UAS ;break ;
include/linux/if_vlan.h +0 -6
@@ -187,7 +187,6 @@ vlan_dev_get_egress_qos_mask(struct net_device *dev, u32 skprio) }extern bool vlan_do_receive (struct sk_buff **skb); -extern struct sk_buff *vlan_untag (struct sk_buff *skb);extern int vlan_vid_add (struct net_device *dev,__be16 proto,u16 vid);extern void vlan_vid_del (struct net_device *dev,__be16 proto,u16 vid);
@@ -241,11 +240,6 @@ static inline bool vlan_do_receive(struct sk_buff **skb)return false; } -static inline struct sk_buff *vlan_untag (struct sk_buff *skb) -{ -return skb; -} -static inline int vlan_vid_add (struct net_device *dev,__be16 proto,u16 vid) {return 0 ;
include/linux/skbuff.h +1 -0
@@ -2549,6 +2549,7 @@ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen);void skb_scrub_packet (struct sk_buff *skb,bool xnet);unsigned int skb_gso_transport_seglen (const struct sk_buff *skb);struct sk_buff *skb_segment (struct sk_buff *skb,netdev_features_t features); +struct sk_buff *skb_vlan_untag (struct sk_buff *skb);struct skb_checksum_ops {__wsum (*update)(const void *mem,int len,__wsum wsum);
include/linux/usb/quirks.h +3 -0
@@ -30,4 +30,7 @@descriptor */ #define USB_QUIRK_DELAY_INIT 0x00000040 +/* device generates spurious wakeup, ignore remote wakeup capability */ +#define USB_QUIRK_IGNORE_REMOTE_WAKEUP 0x00000200 +#endif /* __LINUX_USB_QUIRKS_H */
include/linux/usb_usual.h +4 -0
@@ -73,6 +73,10 @@/* Device advertises UAS but it is broken */ \US_FLAG (BROKEN_FUA ,0x01000000 ) \ /* Cannot handle FUA in WRITE or READ CDBs */ \ +US_FLAG (NO_ATA_1X ,0x02000000 ) \ + /* Cannot handle ATA_12 or ATA_16 CDBs */ \ +US_FLAG (NO_REPORT_OPCODES ,0x04000000 ) \ + /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \#define US_FLAG (name, value) US_FL_##name = value ,enum {US_DO_ALL_FLAGS };
include/net/dst.h +15 -1
@@ -480,6 +480,7 @@ void dst_init(void);/* Flags for xfrm_lookup flags argument. */ enum {XFRM_LOOKUP_ICMP =1 <<0 , +XFRM_LOOKUP_QUEUE =1 <<1 , };struct flowi ;
@@ -490,7 +491,16 @@ static inline struct dst_entry *xfrm_lookup(struct net *net, int flags) {return dst_orig; -} +} + +static inline struct dst_entry *xfrm_lookup_route (struct net *net, +struct dst_entry *dst_orig, +const struct flowi *fl, +struct sock *sk, +int flags) +{ +return dst_orig; +}static inline struct xfrm_state *dst_xfrm (const struct dst_entry *dst) {
@@ -502,6 +512,10 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, const struct flowi *fl, struct sock *sk, int flags); +struct dst_entry *xfrm_lookup_route (struct net *net,struct dst_entry *dst_orig, +const struct flowi *fl,struct sock *sk, +int flags); +/* skb attached with this dst needs transformation if dst->xfrm is valid */ static inline struct xfrm_state *dst_xfrm (const struct dst_entry *dst) {
include/net/inet_connection_sock.h +1 -0
@@ -62,6 +62,7 @@ struct inet_connection_sock_af_ops {void (*addr2sockaddr)(struct sock *sk,struct sockaddr *);int (*bind_conflict)(const struct sock *sk,const struct inet_bind_bucket *tb,bool relax); +void (*mtu_reduced)(struct sock *sk); };/** inet_connection_sock - INET connection oriented sock
include/net/ip6_fib.h +1 -4
@@ -114,16 +114,13 @@ struct rt6_info {u32 rt6i_flags;struct rt6key rt6i_src;struct rt6key rt6i_prefsrc; -u32 rt6i_metric;struct inet6_dev *rt6i_idev;unsigned long _rt6i_peer; -u32 rt6i_genid; - +u32 rt6i_metric;/* more non-fragment space at head required */ unsigned short rt6i_nfheader_len; -u8 rt6i_protocol; };
include/net/net_namespace.h +3 -17
@@ -352,26 +352,12 @@ static inline void rt_genid_bump_ipv4(struct net *net)atomic_inc (&net->ipv4.rt_genid); } -#if IS_ENABLED (CONFIG_IPV6 ) -static inline int rt_genid_ipv6 (struct net *net) -{ -return atomic_read (&net->ipv6.rt_genid); -} - -static inline void rt_genid_bump_ipv6 (struct net *net) -{ -atomic_inc (&net->ipv6.rt_genid); -} -#else -static inline int rt_genid_ipv6 (struct net *net) -{ -return 0 ; -} - +extern void (*__fib6_flush_trees)(struct net *net);static inline void rt_genid_bump_ipv6 (struct net *net) { +if (__fib6_flush_trees) +__fib6_flush_trees (net); } -#endif #if IS_ENABLED (CONFIG_IEEE802154_6LOWPAN ) static inline struct netns_ieee802154_lowpan *
include/net/sctp/command.h +1 -1
@@ -115,7 +115,7 @@ typedef enum {* analysis of the state functions, but in reality just taken from * thin air in the hopes othat we don't trigger a kernel panic. */ -#define SCTP_MAX_NUM_COMMANDS 14 +#define SCTP_MAX_NUM_COMMANDS 20 typedef union { __s32 i32;
include/net/sock.h +0 -1
@@ -971,7 +971,6 @@ struct proto { struct sk_buff *skb);void (*release_cb)(struct sock *sk); -void (*mtu_reduced)(struct sock *sk);/* Keeping track of sk's, looking them up, and port selection methods. */ void (*hash)(struct sock *sk);
include/net/tcp.h +4 -1
@@ -448,6 +448,7 @@ const u8 *tcp_parse_md5sig_option(const struct tcphdr *th);*/ void tcp_v4_send_check (struct sock *sk,struct sk_buff *skb); +void tcp_v4_mtu_reduced (struct sock *sk);int tcp_v4_conn_request (struct sock *sk,struct sk_buff *skb); struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
@@ -718,8 +719,10 @@ struct tcp_skb_cb {#define TCPCB_SACKED_RETRANS 0x02/* SKB retransmitted */ #define TCPCB_LOST 0x04/* SKB is lost */ #define TCPCB_TAGBITS 0x07/* All tag bits */ +#define TCPCB_REPAIRED 0x10/* SKB repaired (no skb_mstamp) */ #define TCPCB_EVER_RETRANS 0x80/* Ever retransmitted frame */ -#define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) +#define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS| \ + TCPCB_REPAIRED)__u8 ip_dsfield;/* IPv4 tos or IPv6 dsfield */ /* 1 byte hole */
net/8021q/vlan_core.c +0 -53
59 lines not on this page · raw message
net/bridge/br_private.h +3 -0
@@ -309,6 +309,9 @@ struct br_input_skb_cb {int igmp;int mrouters_only;#endif +#ifdef CONFIG_BRIDGE_VLAN_FILTERING +bool vlan_filtered; +#endif };#define BR_INPUT_SKB_CB (__skb) ((struct br_input_skb_cb *)(__skb)->cb)
net/bridge/br_vlan.c +10 -4
@@ -127,7 +127,8 @@ struct sk_buff *br_handle_vlan(struct net_bridge *br, {u16 vid; -if (!br->vlan_enabled) +/* If this packet was not filtered at input, let it pass */ +if (!BR_INPUT_SKB_CB (skb)->vlan_filtered) goto out;/* Vlan filter table must be configured at this point. The
@@ -166,8 +167,10 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,/* If VLAN filtering is disabled on the bridge, all packets are * permitted. */ -if (!br->vlan_enabled) +if (!br->vlan_enabled) { +BR_INPUT_SKB_CB (skb)->vlan_filtered = false;return true; + }/* If there are no vlan in the permitted list, all packets are * rejected.
@@ -175,6 +178,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,if (!v) goto drop; +BR_INPUT_SKB_CB (skb)->vlan_filtered = true; proto = br->vlan_proto;/* If vlan tx offload is disabled on bridge device and frame was
@@ -183,7 +187,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,*/ if (unlikely (!vlan_tx_tag_present (skb) && skb->protocol == proto)) { - skb =vlan_untag (skb); + skb =skb_vlan_untag (skb);if (unlikely (!skb))return false; }
@@ -253,7 +257,8 @@ bool br_allowed_egress(struct net_bridge *br, {u16 vid; -if (!br->vlan_enabled) +/* If this packet was not filtered at input, let it pass */ +if (!BR_INPUT_SKB_CB (skb)->vlan_filtered)return true;if (!v)
@@ -272,6 +277,7 @@ bool br_should_learn(struct net_bridge_port *p, struct sk_buff *skb, u16 *vid)struct net_bridge *br = p->br;struct net_port_vlans *v; +/* If filtering was disabled at input, let it pass. */ if (!br->vlan_enabled)return true;
net/core/dev.c +12 -6
@@ -2576,13 +2576,19 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)return harmonize_features (skb, features); } - features &= (skb->dev->vlan_features |NETIF_F_HW_VLAN_CTAG_TX | -NETIF_F_HW_VLAN_STAG_TX ); + features =netdev_intersect_features (features, + skb->dev->vlan_features | +NETIF_F_HW_VLAN_CTAG_TX | +NETIF_F_HW_VLAN_STAG_TX );if (protocol ==htons (ETH_P_8021Q ) || protocol ==htons (ETH_P_8021AD )) - features &=NETIF_F_SG |NETIF_F_HIGHDMA |NETIF_F_FRAGLIST | -NETIF_F_GEN_CSUM |NETIF_F_HW_VLAN_CTAG_TX | -NETIF_F_HW_VLAN_STAG_TX ; + features =netdev_intersect_features (features, +NETIF_F_SG | +NETIF_F_HIGHDMA | +NETIF_F_FRAGLIST | +NETIF_F_GEN_CSUM | +NETIF_F_HW_VLAN_CTAG_TX | +NETIF_F_HW_VLAN_STAG_TX );return harmonize_features (skb, features); }
@@ -3588,7 +3594,7 @@ another_round:if (skb->protocol ==cpu_to_be16 (ETH_P_8021Q ) || skb->protocol ==cpu_to_be16 (ETH_P_8021AD )) { - skb =vlan_untag (skb); + skb =skb_vlan_untag (skb);if (unlikely (!skb)) goto unlock; }
net/core/filter.c +1 -0
@@ -1318,6 +1318,7 @@ static int sk_store_orig_filter(struct sk_filter *fp, fkprog->filter =kmemdup (fp->insns, fsize,GFP_KERNEL );if (!fkprog->filter) {kfree (fp->orig_prog); + fp->orig_prog =NULL ;return -ENOMEM ; }
net/core/rtnetlink.c +2 -1
@@ -799,7 +799,8 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev, (nla_total_size (sizeof (struct ifla_vf_mac )) +nla_total_size (sizeof (struct ifla_vf_vlan )) +nla_total_size (sizeof (struct ifla_vf_spoofchk )) + -nla_total_size (sizeof (struct ifla_vf_rate ))); +nla_total_size (sizeof (struct ifla_vf_rate )) + +nla_total_size (sizeof (struct ifla_vf_link_state )));return size; }else return 0 ;
net/core/skbuff.c +56 -0
71 lines not on this page · raw message
net/ipv4/ip_tunnel.c +8 -3
@@ -764,9 +764,14 @@ int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd) t =ip_tunnel_find (itn, p, itn->fb_tunnel_dev->type); -if (!t && (cmd ==SIOCADDTUNNEL )) { - t =ip_tunnel_create (net, itn, p); - err =PTR_ERR_OR_ZERO (t); +if (cmd ==SIOCADDTUNNEL ) { +if (!t) { + t =ip_tunnel_create (net, itn, p); + err =PTR_ERR_OR_ZERO (t); +break ; + } + + err = -EEXIST ;break ; }if (dev != itn->fb_tunnel_dev && cmd ==SIOCCHGTUNNEL ) {
net/ipv4/route.c +3 -3
@@ -2267,9 +2267,9 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,return rt;if (flp4->flowi4_proto) - rt = (struct rtable *)xfrm_lookup (net, &rt->dst, -flowi4_to_flowi (flp4), - sk,0 ); + rt = (struct rtable *)xfrm_lookup_route (net, &rt->dst, +flowi4_to_flowi (flp4), + sk,0 );return rt; }
net/ipv4/tcp.c +7 -7
@@ -1175,13 +1175,6 @@ new_segment: goto wait_for_memory;/* -* All packets are restored as if they have -* already been sent. -*/ -if (tp->repair) -TCP_SKB_CB (skb)->when = tcp_time_stamp; - -/* * Check whether we can use HW checksum. */ if (sk->sk_route_caps &NETIF_F_ALL_CSUM )
@@ -1190,6 +1183,13 @@ new_segment:skb_entail (sk, skb); copy = size_goal; max = size_goal; + +/* All packets are restored as if they have +* already been sent. skb_mstamp isn't set to +* avoid wrong rtt estimation. +*/ +if (tp->repair) +TCP_SKB_CB (skb)->sacked |=TCPCB_REPAIRED ; }/* Try to append data to the end of skb. */
net/ipv4/tcp_input.c +3 -5
@@ -2680,7 +2680,6 @@ static void tcp_enter_recovery(struct sock *sk, bool ece_ack)*/ static void tcp_process_loss (struct sock *sk,int flag,bool is_dupack) { -struct inet_connection_sock *icsk =inet_csk (sk);struct tcp_sock *tp =tcp_sk (sk);bool recovered = !before (tp->snd_una, tp->high_seq);
@@ -2706,12 +2705,9 @@ static void tcp_process_loss(struct sock *sk, int flag, bool is_dupack)if (recovered) {/* F-RTO RFC5682 sec 3.1 step 2.a and 1st part of step 3.a */ - icsk->icsk_retransmits =0 ;tcp_try_undo_recovery (sk);return ; } -if (flag &FLAG_DATA_ACKED ) - icsk->icsk_retransmits =0 ;if (tcp_is_reno (tp)) {/* A Reno DUPACK means new data in F-RTO step 2.b above are * delivered. Lower inflight to clock out (re)tranmissions.
@@ -3393,8 +3389,10 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) icsk->icsk_pending == ICSK_TIME_LOSS_PROBE)tcp_rearm_rto (sk); -if (after (ack, prior_snd_una)) +if (after (ack, prior_snd_una)) { flag |=FLAG_SND_UNA_ADVANCED ; + icsk->icsk_retransmits =0 ; + } prior_fackets = tp->fackets_out;
net/ipv4/tcp_ipv4.c +3 -2
@@ -269,7 +269,7 @@ EXPORT_SYMBOL(tcp_v4_connect);* It can be called through tcp_release_cb() if socket was owned by user * at the time tcp_v4_err() was called to handle ICMP message. */ -static void tcp_v4_mtu_reduced (struct sock *sk) +void tcp_v4_mtu_reduced (struct sock *sk) {struct dst_entry *dst;struct inet_sock *inet =inet_sk (sk);
@@ -300,6 +300,7 @@ static void tcp_v4_mtu_reduced(struct sock *sk)tcp_simple_retransmit (sk); }/* else let the usual retransmit timer handle it */ } +EXPORT_SYMBOL (tcp_v4_mtu_reduced);static void do_redirect (struct sk_buff *skb,struct sock *sk) {
@@ -1880,6 +1881,7 @@ const struct inet_connection_sock_af_ops ipv4_specific = { .compat_setsockopt = compat_ip_setsockopt, .compat_getsockopt = compat_ip_getsockopt, #endif + .mtu_reduced = tcp_v4_mtu_reduced, };EXPORT_SYMBOL (ipv4_specific);
@@ -2499,7 +2501,6 @@ struct proto tcp_prot = { .sendpage = tcp_sendpage, .backlog_rcv = tcp_v4_do_rcv, .release_cb = tcp_release_cb, - .mtu_reduced = tcp_v4_mtu_reduced, .hash = inet_hash, .unhash = inet_unhash, .get_port = inet_csk_get_port,
net/ipv4/tcp_output.c +5 -2
@@ -800,7 +800,7 @@ void tcp_release_cb(struct sock *sk)__sock_put (sk); }if (flags & (1UL <<TCP_MTU_REDUCED_DEFERRED )) { - sk->sk_prot->mtu_reduced (sk); +inet_csk (sk)->icsk_af_ops->mtu_reduced (sk);__sock_put (sk); } }
@@ -1916,8 +1916,11 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, tso_segs =tcp_init_tso_segs (sk, skb, mss_now);BUG_ON (!tso_segs); -if (unlikely (tp->repair) && tp->repair_queue ==TCP_SEND_QUEUE ) +if (unlikely (tp->repair) && tp->repair_queue ==TCP_SEND_QUEUE ) { +/* "when" is used as a start point for the retransmit timer */ +TCP_SKB_CB (skb)->when = tcp_time_stamp; goto repair;/* Skip network transmission */ + } cwnd_quota =tcp_cwnd_test (tp, skb);if (!cwnd_quota) {
net/ipv6/addrconf.c +7 -11
@@ -1679,14 +1679,12 @@ void addrconf_dad_failure(struct inet6_ifaddr *ifp)addrconf_mod_dad_work (ifp,0 ); } -/* Join to solicited addr multicast group. */ - +/* Join to solicited addr multicast group. +* caller must hold RTNL */ void addrconf_join_solict (struct net_device *dev,const struct in6_addr *addr) {struct in6_addr maddr; -ASSERT_RTNL (); -if (dev->flags&(IFF_LOOPBACK |IFF_NOARP ))return ;
@@ -1694,12 +1692,11 @@ void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr)ipv6_dev_mc_inc (dev, &maddr); } +/* caller must hold RTNL */ void addrconf_leave_solict (struct inet6_dev *idev,const struct in6_addr *addr) {struct in6_addr maddr; -ASSERT_RTNL (); -if (idev->dev->flags&(IFF_LOOPBACK |IFF_NOARP ))return ;
@@ -1707,12 +1704,11 @@ void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr)__ipv6_dev_mc_dec (idev, &maddr); } +/* caller must hold RTNL */ static void addrconf_join_anycast (struct inet6_ifaddr *ifp) {struct in6_addr addr; -ASSERT_RTNL (); -if (ifp->prefix_len >=127 )/* RFC 6164 */ return ;ipv6_addr_prefix (&addr, &ifp->addr, ifp->prefix_len);
@@ -1721,12 +1717,11 @@ static void addrconf_join_anycast(struct inet6_ifaddr *ifp)ipv6_dev_ac_inc (ifp->idev->dev, &addr); } +/* caller must hold RTNL */ static void addrconf_leave_anycast (struct inet6_ifaddr *ifp) {struct in6_addr addr; -ASSERT_RTNL (); -if (ifp->prefix_len >=127 )/* RFC 6164 */ return ;ipv6_addr_prefix (&addr, &ifp->addr, ifp->prefix_len);
@@ -4751,10 +4746,11 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)if (ip6_del_rt (ifp->rt))dst_free (&ifp->rt->dst); + +rt_genid_bump_ipv6 (net);break ; }atomic_inc (&net->ipv6.dev_addr_genid); -rt_genid_bump_ipv6 (net); }static void ipv6_ifa_notify (int event,struct inet6_ifaddr *ifp)
net/ipv6/addrconf_core.c +7 -0
@@ -8,6 +8,13 @@#include <net/addrconf.h> #include <net/ip.h> +/* if ipv6 module registers this function is used by xfrm to force all +* sockets to relookup their nodes - this is fairly expensive, be +* careful +*/ +void (*__fib6_flush_trees)(struct net *); +EXPORT_SYMBOL (__fib6_flush_trees); +#define IPV6_ADDR_SCOPE_TYPE (scope) ((scope) << 16)static inline unsigned int ipv6_addr_scope2type (unsigned int scope)
net/ipv6/anycast.c +10 -0
@@ -77,6 +77,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr) pac->acl_next =NULL ; pac->acl_addr = *addr; +rtnl_lock ();rcu_read_lock ();if (ifindex ==0 ) {struct rt6_info *rt;
@@ -137,6 +138,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr) error:rcu_read_unlock (); +rtnl_unlock ();if (pac)sock_kfree_s (sk, pac,sizeof (*pac));return err;
@@ -171,11 +173,13 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)spin_unlock_bh (&ipv6_sk_ac_lock); +rtnl_lock ();rcu_read_lock (); dev =dev_get_by_index_rcu (net, pac->acl_ifindex);if (dev)ipv6_dev_ac_dec (dev, &pac->acl_addr);rcu_read_unlock (); +rtnl_unlock ();sock_kfree_s (sk, pac,sizeof (*pac));return 0 ;
@@ -198,6 +202,7 @@ void ipv6_sock_ac_close(struct sock *sk)spin_unlock_bh (&ipv6_sk_ac_lock); prev_index =0 ; +rtnl_lock ();rcu_read_lock ();while (pac) {struct ipv6_ac_socklist *next = pac->acl_next;
@@ -212,6 +217,7 @@ void ipv6_sock_ac_close(struct sock *sk) pac = next; }rcu_read_unlock (); +rtnl_unlock (); }static void aca_put (struct ifacaddr6 *ac)
@@ -233,6 +239,8 @@ int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr)struct rt6_info *rt;int err; +ASSERT_RTNL (); + idev =in6_dev_get (dev);if (idev ==NULL )
@@ -302,6 +310,8 @@ int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr) {struct ifacaddr6 *aca, *prev_aca; +ASSERT_RTNL (); +write_lock_bh (&idev->lock); prev_aca =NULL ;for (aca = idev->ac_list; aca; aca = aca->aca_next) {
net/ipv6/ip6_fib.c +21 -1
@@ -643,7 +643,7 @@ static int fib6_commit_metrics(struct dst_entry *dst,if (dst->flags &DST_HOST ) { mp =dst_metrics_write_ptr (dst); }else { - mp =kzalloc (sizeof (u32) *RTAX_MAX ,GFP_KERNEL ); + mp =kzalloc (sizeof (u32) *RTAX_MAX ,GFP_ATOMIC );if (!mp)return -ENOMEM ;dst_init_metrics (dst, mp,0 );
@@ -1605,6 +1605,24 @@ static void fib6_prune_clones(struct net *net, struct fib6_node *fn)fib6_clean_tree (net, fn, fib6_prune_clone,1 ,NULL ); } +static int fib6_update_sernum (struct rt6_info *rt,void *arg) +{ +__u32 sernum = *(__u32 *)arg; + +if (rt->rt6i_node && + rt->rt6i_node->fn_sernum != sernum) + rt->rt6i_node->fn_sernum = sernum; + +return 0 ; +} + +static void fib6_flush_trees (struct net *net) +{ +__u32 new_sernum =fib6_new_sernum (); + +fib6_clean_all (net, fib6_update_sernum, &new_sernum); +} +/* * Garbage collection */
@@ -1788,6 +1806,8 @@ int __init fib6_init(void) NULL);if (ret) goto out_unregister_subsys; + + __fib6_flush_trees = fib6_flush_trees; out:return ret;
net/ipv6/ip6_gre.c +2 -2
@@ -778,7 +778,7 @@ static inline int ip6gre_xmit_ipv4(struct sk_buff *skb, struct net_device *dev) encap_limit = t->parms.encap_limit;memcpy (&fl6, &t->fl.u.ip6,sizeof (fl6)); - fl6.flowi6_proto =IPPROTO_IPIP ; + fl6.flowi6_proto =IPPROTO_GRE ; dsfield =ipv4_get_dsfield (iph);
@@ -828,7 +828,7 @@ static inline int ip6gre_xmit_ipv6(struct sk_buff *skb, struct net_device *dev) encap_limit = t->parms.encap_limit;memcpy (&fl6, &t->fl.u.ip6,sizeof (fl6)); - fl6.flowi6_proto =IPPROTO_IPV6 ; + fl6.flowi6_proto =IPPROTO_GRE ; dsfield =ipv6_get_dsfield (ipv6h);if (t->parms.flags &IP6_TNL_F_USE_ORIG_TCLASS )
net/ipv6/ip6_output.c +2 -2
@@ -1008,7 +1008,7 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,if (final_dst) fl6->daddr = *final_dst; -return xfrm_lookup (sock_net (sk), dst,flowi6_to_flowi (fl6), sk,0 ); +return xfrm_lookup_route (sock_net (sk), dst,flowi6_to_flowi (fl6), sk,0 ); }EXPORT_SYMBOL_GPL (ip6_dst_lookup_flow);
@@ -1040,7 +1040,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,if (final_dst) fl6->daddr = *final_dst; -return xfrm_lookup (sock_net (sk), dst,flowi6_to_flowi (fl6), sk,0 ); +return xfrm_lookup_route (sock_net (sk), dst,flowi6_to_flowi (fl6), sk,0 ); }EXPORT_SYMBOL_GPL (ip6_sk_dst_lookup_flow);
net/ipv6/mcast.c +14 -0
@@ -172,6 +172,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr) mc_lst->next =NULL ; mc_lst->addr = *addr; +rtnl_lock ();rcu_read_lock ();if (ifindex ==0 ) {struct rt6_info *rt;
@@ -185,6 +186,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)if (dev ==NULL ) {rcu_read_unlock (); +rtnl_unlock ();sock_kfree_s (sk, mc_lst,sizeof (*mc_lst));return -ENODEV ; }
@@ -202,6 +204,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)if (err) {rcu_read_unlock (); +rtnl_unlock ();sock_kfree_s (sk, mc_lst,sizeof (*mc_lst));return err; }
@@ -212,6 +215,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)spin_unlock (&ipv6_sk_mc_lock);rcu_read_unlock (); +rtnl_unlock ();return 0 ; }
@@ -229,6 +233,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)if (!ipv6_addr_is_multicast (addr))return -EINVAL ; +rtnl_lock ();spin_lock (&ipv6_sk_mc_lock); for (lnk = &np->ipv6_mc_list; (mc_lst = rcu_dereference_protected(*lnk,
@@ -252,12 +257,15 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr) }else (void )ip6_mc_leave_src (sk, mc_lst,NULL );rcu_read_unlock (); +rtnl_unlock (); +atomic_sub (sizeof (*mc_lst), &sk->sk_omem_alloc);kfree_rcu (mc_lst, rcu);return 0 ; } }spin_unlock (&ipv6_sk_mc_lock); +rtnl_unlock ();return -EADDRNOTAVAIL ; }
@@ -302,6 +310,7 @@ void ipv6_sock_mc_close(struct sock *sk)if (!rcu_access_pointer (np->ipv6_mc_list))return ; +rtnl_lock ();spin_lock (&ipv6_sk_mc_lock);while ((mc_lst =rcu_dereference_protected (np->ipv6_mc_list,lockdep_is_held (&ipv6_sk_mc_lock))) !=NULL ) {
@@ -328,6 +337,7 @@ void ipv6_sock_mc_close(struct sock *sk)spin_lock (&ipv6_sk_mc_lock); }spin_unlock (&ipv6_sk_mc_lock); +rtnl_unlock (); } int ip6_mc_source(int add, int omode, struct sock *sk,
@@ -845,6 +855,8 @@ int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr)struct ifmcaddr6 *mc;struct inet6_dev *idev; +ASSERT_RTNL (); +/* we need to take a reference on idev */ idev =in6_dev_get (dev);
@@ -916,6 +928,8 @@ int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr) {struct ifmcaddr6 *ma, **map; +ASSERT_RTNL (); +write_lock_bh (&idev->lock);for (map = &idev->mc_list; (ma=*map) !=NULL ; map = &ma->next) {if (ipv6_addr_equal (&ma->mca_addr, addr)) {
net/ipv6/route.c +0 -4
@@ -314,7 +314,6 @@ static inline struct rt6_info *ip6_dst_alloc(struct net *net,memset (dst +1 ,0 ,sizeof (*rt) -sizeof (*dst));rt6_init_peer (rt, table ? &table->tb6_peers : net->ipv6.peers); - rt->rt6i_genid =rt_genid_ipv6 (net);INIT_LIST_HEAD (&rt->rt6i_siblings); }return rt;
@@ -1098,9 +1097,6 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)* DST_OBSOLETE_FORCE_CHK which forces validation calls down * into this function always. */ -if (rt->rt6i_genid !=rt_genid_ipv6 (dev_net (rt->dst.dev))) -return NULL ; -if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie))return NULL ;
net/ipv6/sit.c +3 -3
@@ -101,19 +101,19 @@ static struct ip_tunnel *ipip6_tunnel_lookup(struct net *net,for_each_ip_tunnel_rcu (t, sitn->tunnels_r_l[h0 ^ h1]) {if (local == t->parms.iph.saddr && remote == t->parms.iph.daddr && - (!dev || !t->parms.link || dev->iflink == t->parms.link) && + (!dev || !t->parms.link || dev->ifindex == t->parms.link) && (t->dev->flags &IFF_UP ))return t; }for_each_ip_tunnel_rcu (t, sitn->tunnels_r[h0]) {if (remote == t->parms.iph.daddr && - (!dev || !t->parms.link || dev->iflink == t->parms.link) && + (!dev || !t->parms.link || dev->ifindex == t->parms.link) && (t->dev->flags &IFF_UP ))return t; }for_each_ip_tunnel_rcu (t, sitn->tunnels_l[h1]) {if (local == t->parms.iph.saddr && - (!dev || !t->parms.link || dev->iflink == t->parms.link) && + (!dev || !t->parms.link || dev->ifindex == t->parms.link) && (t->dev->flags &IFF_UP ))return t; }
net/ipv6/tcp_ipv6.c +2 -1
@@ -1681,6 +1681,7 @@ static const struct inet_connection_sock_af_ops ipv6_specific = { .compat_setsockopt = compat_ipv6_setsockopt, .compat_getsockopt = compat_ipv6_getsockopt, #endif + .mtu_reduced = tcp_v6_mtu_reduced, };#ifdef CONFIG_TCP_MD5SIG
@@ -1711,6 +1712,7 @@ static const struct inet_connection_sock_af_ops ipv6_mapped = { .compat_setsockopt = compat_ipv6_setsockopt, .compat_getsockopt = compat_ipv6_getsockopt, #endif + .mtu_reduced = tcp_v4_mtu_reduced, };#ifdef CONFIG_TCP_MD5SIG
@@ -1950,7 +1952,6 @@ struct proto tcpv6_prot = { .sendpage = tcp_sendpage, .backlog_rcv = tcp_v6_do_rcv, .release_cb = tcp_release_cb, - .mtu_reduced = tcp_v6_mtu_reduced, .hash = tcp_v6_hash, .unhash = inet_unhash, .get_port = inet_csk_get_port,
net/l2tp/l2tp_ppp.c +2 -1
@@ -755,7 +755,8 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,/* If PMTU discovery was enabled, use the MTU that was discovered */ dst =sk_dst_get (tunnel->sock);if (dst !=NULL ) { -u32 pmtu =dst_mtu (__sk_dst_get (tunnel->sock)); +u32 pmtu =dst_mtu (dst); +if (pmtu !=0 ) session->mtu = session->mru = pmtu -PPPOL2TP_HEADER_OVERHEAD ;
net/netlink/af_netlink.c +1 -1
@@ -205,7 +205,7 @@ static int __netlink_deliver_tap_skb(struct sk_buff *skb, nskb->protocol =htons ((u16 ) sk->sk_protocol); nskb->pkt_type =netlink_is_kernel (sk) ?PACKET_KERNEL :PACKET_USER ; - +skb_reset_network_header (nskb); ret =dev_queue_xmit (nskb);if (unlikely (ret >0 )) ret =net_xmit_errno (ret);
net/openvswitch/actions.c +5 -0
@@ -42,6 +42,9 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,static int make_writable (struct sk_buff *skb,int write_len) { +if (!pskb_may_pull (skb, write_len)) +return -ENOMEM ; +if (!skb_cloned (skb) ||skb_clone_writable (skb, write_len))return 0 ;
@@ -70,6 +73,8 @@ static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci)vlan_set_encap_proto (skb, vhdr); skb->mac_header +=VLAN_HLEN ; +if (skb_network_offset (skb) <ETH_HLEN ) +skb_set_network_header (skb,ETH_HLEN );skb_reset_mac_len (skb);return 0 ;
net/packet/af_packet.c +17 -0
@@ -636,6 +636,7 @@ static void init_prb_bdqc(struct packet_sock *po, p1->tov_in_jiffies =msecs_to_jiffies (p1->retire_blk_tov); p1->blk_sizeof_priv = req_u->req3.tp_sizeof_priv; + p1->max_frame_len = p1->kblk_size -BLK_PLUS_PRIV (p1->blk_sizeof_priv);prb_init_ft_ops (p1, req_u);prb_setup_retire_blk_timer (po, tx_ring);prb_open_block (p1, pbd);
@@ -1946,6 +1947,18 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,if ((int )snaplen <0 ) snaplen =0 ; } + }else if (unlikely (macoff + snaplen > +GET_PBDQC_FROM_RB (&po->rx_ring)->max_frame_len)) { +u32 nval; + + nval =GET_PBDQC_FROM_RB (&po->rx_ring)->max_frame_len - macoff; +pr_err_once ("tpacket_rcv: packet too big, clamped from %u to %u. macoff=%u\n" , + snaplen, nval, macoff); + snaplen = nval; +if (unlikely ((int )snaplen <0 )) { + snaplen =0 ; + macoff =GET_PBDQC_FROM_RB (&po->rx_ring)->max_frame_len; + } }spin_lock (&sk->sk_receive_queue.lock); h.raw = packet_current_rx_frame(po, skb,
@@ -3789,6 +3802,10 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, goto out;if (unlikely (req->tp_block_size & (PAGE_SIZE -1 ))) goto out; +if (po->tp_version >=TPACKET_V3 && + (int )(req->tp_block_size - +BLK_PLUS_PRIV (req_u->req3.tp_sizeof_priv)) <=0 ) + goto out;if (unlikely (req->tp_frame_size < po->tp_hdrlen + po->tp_reserve)) goto out;
net/packet/internal.h +1 -0
@@ -29,6 +29,7 @@ struct tpacket_kbdq_core {char *pkblk_start;char *pkblk_end;int kblk_size; +unsigned int max_frame_len;unsigned int knum_blocks;uint64_t knxt_seq_num;char *prev;
net/sched/cls_api.c +1 -0
@@ -549,6 +549,7 @@ void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,tcf_tree_lock (tp);list_splice_init (&dst->actions, &tmp);list_splice (&src->actions, &dst->actions); + dst->type = src->type;tcf_tree_unlock (tp);tcf_action_destroy (&tmp,TCA_ACT_UNBIND );#endif
net/sctp/sm_statefuns.c +16 -3
@@ -1775,9 +1775,22 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(struct net *net,/* Update the content of current association. */ sctp_add_cmd_sf (commands,SCTP_CMD_UPDATE_ASSOC ,SCTP_ASOC (new_asoc));sctp_add_cmd_sf (commands,SCTP_CMD_EVENT_ULP ,SCTP_ULPEVENT (ev)); -sctp_add_cmd_sf (commands,SCTP_CMD_NEW_STATE , -SCTP_STATE (SCTP_STATE_ESTABLISHED )); -sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (repl)); +if (sctp_state (asoc,SHUTDOWN_PENDING ) && + (sctp_sstate (asoc->base.sk,CLOSING ) || +sock_flag (asoc->base.sk,SOCK_DEAD ))) { +/* if were currently in SHUTDOWN_PENDING, but the socket +* has been closed by user, don't transition to ESTABLISHED. +* Instead trigger SHUTDOWN bundled with COOKIE_ACK. +*/ +sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (repl)); +return sctp_sf_do_9_2_start_shutdown (net, ep, asoc, +SCTP_ST_CHUNK (0 ),NULL , + commands); + }else { +sctp_add_cmd_sf (commands,SCTP_CMD_NEW_STATE , +SCTP_STATE (SCTP_STATE_ESTABLISHED )); +sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (repl)); + }return SCTP_DISPOSITION_CONSUME ; nomem_ev:
net/tipc/port.h +4 -1
@@ -229,9 +229,12 @@ static inline int tipc_port_importance(struct tipc_port *port) return msg_importance(&port->phdr); } -static inline void tipc_port_set_importance (struct tipc_port *port,int imp) +static inline int tipc_port_set_importance (struct tipc_port *port,int imp) { +if (imp >TIPC_CRITICAL_IMPORTANCE ) +return -EINVAL ;msg_set_importance (&port->phdr, (u32 )imp); +return 0 ; }#endif
net/tipc/socket.c +1 -1
@@ -1841,7 +1841,7 @@ static int tipc_setsockopt(struct socket *sock, int lvl, int opt,switch (opt) {case TIPC_IMPORTANCE : -tipc_port_set_importance (port, value); + res =tipc_port_set_importance (port, value);break ;case TIPC_SRC_DROPPABLE :if (sock->type !=SOCK_STREAM )
net/xfrm/xfrm_policy.c +40 -8
122 lines not on this page · raw message