Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

1) Don't halt the firmware in r8152 driver, from Hayes Wang.

2) Handle full sized 802.1ad frames in bnx2 and tg3 drivers properly,
from Vlad Yasevich.

3) Don't sleep while holding tx_clean_lock in netxen driver, fix from
Manish Chopra.

4) Certain kinds of ipv6 routes can end up endlessly failing the route
validation test, causing it to be re-looked up over and over again.
This particularly kills input route caching in TCP sockets. Fix
from Hannes Frederic Sowa.

5) netvsc_start_xmit() has a use-after-free access to skb->len, fix
from K Y Srinivasan.

6) Fix matching of inverted containers in ematch module, from Ignacy
Gawędzki.

7) Aggregation of GRO frames via SKB ->frag_list for linear skbs isn't
handled properly, regression fix from Eric Dumazet.

8) Don't test return value of ipv4_neigh_lookup(), which returns an
error pointer, against NULL. From WANG Cong.

9) Fix an old regression where we mistakenly allow a double add of the
same tunnel. Fixes from Steffen Klassert.

10) macvtap device delete and open can run in parallel and corrupt lists
etc., fix from Vlad Yasevich.

11) Fix build error with IPV6=m NETFILTER_XT_TARGET_TPROXY=y, from Pablo
Neira Ayuso.

12) rhashtable_destroy() triggers lockdep splats, fix also from Pablo.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (32 commits)
bna: Update Maintainer Email
r8152: disable power cut for RTL8153
r8152: remove clearing bp
bnx2: Correctly receive full sized 802.1ad fragmes
tg3: Allow for recieve of full-size 8021AD frames
r8152: fix setting RTL8152_UNPLUG
netxen: Fix bug in Tx completion path.
netxen: Fix BUG "sleeping function called from invalid context"
ipv6: remove rt6i_genid
hyperv: Fix a bug in netvsc_start_xmit()
net: stmmac: fix stmmac_pci_probe failed when CONFIG_HAVE_CLK is selected
ematch: Fix matching of inverted containers.
gro: fix aggregation for skb using frag_list
neigh: check error pointer instead of NULL for ipv4_neigh_lookup()
ip6_gre: Return an error when adding an existing tunnel.
ip6_vti: Return an error when adding an existing tunnel.
ip6_tunnel: Return an error when adding an existing tunnel.
ip6gre: add a rtnl link alias for ip6gretap
net/mlx4_core: Allow not to specify probe_vf in SRIOV IB mode
r8152: fix the carrier off when autoresuming
...

+217 -134
+1 -1
MAINTAINERS
··· 2098 2098 F: drivers/scsi/bfa/ 2099 2099 2100 2100 BROCADE BNA 10 GIGABIT ETHERNET DRIVER 2101 - M: Rasesh Mody <rmody@brocade.com> 2101 + M: Rasesh Mody <rasesh.mody@qlogic.com> 2102 2102 L: netdev@vger.kernel.org 2103 2103 S: Supported 2104 2104 F: drivers/net/ethernet/brocade/bna/
+3 -2
drivers/net/ethernet/broadcom/bnx2.c
··· 3236 3236 3237 3237 skb->protocol = eth_type_trans(skb, bp->dev); 3238 3238 3239 - if ((len > (bp->dev->mtu + ETH_HLEN)) && 3240 - (ntohs(skb->protocol) != 0x8100)) { 3239 + if (len > (bp->dev->mtu + ETH_HLEN) && 3240 + skb->protocol != htons(0x8100) && 3241 + skb->protocol != htons(ETH_P_8021AD)) { 3241 3242 3242 3243 dev_kfree_skb(skb); 3243 3244 goto next_rx;
+2 -1
drivers/net/ethernet/broadcom/tg3.c
··· 6918 6918 skb->protocol = eth_type_trans(skb, tp->dev); 6919 6919 6920 6920 if (len > (tp->dev->mtu + ETH_HLEN) && 6921 - skb->protocol != htons(ETH_P_8021Q)) { 6921 + skb->protocol != htons(ETH_P_8021Q) && 6922 + skb->protocol != htons(ETH_P_8021AD)) { 6922 6923 dev_kfree_skb_any(skb); 6923 6924 goto drop_it_no_recycle; 6924 6925 }
-11
drivers/net/ethernet/cadence/macb.c
··· 30 30 #include <linux/of_device.h> 31 31 #include <linux/of_mdio.h> 32 32 #include <linux/of_net.h> 33 - #include <linux/pinctrl/consumer.h> 34 33 35 34 #include "macb.h" 36 35 ··· 2070 2071 struct phy_device *phydev; 2071 2072 u32 config; 2072 2073 int err = -ENXIO; 2073 - struct pinctrl *pinctrl; 2074 2074 const char *mac; 2075 2075 2076 2076 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2077 2077 if (!regs) { 2078 2078 dev_err(&pdev->dev, "no mmio resource defined\n"); 2079 2079 goto err_out; 2080 - } 2081 - 2082 - pinctrl = devm_pinctrl_get_select_default(&pdev->dev); 2083 - if (IS_ERR(pinctrl)) { 2084 - err = PTR_ERR(pinctrl); 2085 - if (err == -EPROBE_DEFER) 2086 - goto err_out; 2087 - 2088 - dev_warn(&pdev->dev, "No pinctrl provided\n"); 2089 2080 } 2090 2081 2091 2082 err = -ENOMEM;
+2 -2
drivers/net/ethernet/mellanox/mlx4/main.c
··· 78 78 #endif /* CONFIG_PCI_MSI */ 79 79 80 80 static uint8_t num_vfs[3] = {0, 0, 0}; 81 - static int num_vfs_argc = 3; 81 + static int num_vfs_argc; 82 82 module_param_array(num_vfs, byte , &num_vfs_argc, 0444); 83 83 MODULE_PARM_DESC(num_vfs, "enable #num_vfs functions if num_vfs > 0\n" 84 84 "num_vfs=port1,port2,port1+2"); 85 85 86 86 static uint8_t probe_vf[3] = {0, 0, 0}; 87 - static int probe_vfs_argc = 3; 87 + static int probe_vfs_argc; 88 88 module_param_array(probe_vf, byte, &probe_vfs_argc, 0444); 89 89 MODULE_PARM_DESC(probe_vf, "number of vfs to probe by pf driver (num_vfs > 0)\n" 90 90 "probe_vf=port1,port2,port1+2");
+4 -2
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
··· 135 135 int i, j; 136 136 struct nx_host_tx_ring *tx_ring = adapter->tx_ring; 137 137 138 + spin_lock(&adapter->tx_clean_lock); 138 139 cmd_buf = tx_ring->cmd_buf_arr; 139 140 for (i = 0; i < tx_ring->num_desc; i++) { 140 141 buffrag = cmd_buf->frag_array; ··· 159 158 } 160 159 cmd_buf++; 161 160 } 161 + spin_unlock(&adapter->tx_clean_lock); 162 162 } 163 163 164 164 void netxen_free_sw_resources(struct netxen_adapter *adapter) ··· 1794 1792 break; 1795 1793 } 1796 1794 1797 - if (count && netif_running(netdev)) { 1798 - tx_ring->sw_consumer = sw_consumer; 1795 + tx_ring->sw_consumer = sw_consumer; 1799 1796 1797 + if (count && netif_running(netdev)) { 1800 1798 smp_mb(); 1801 1799 1802 1800 if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev))
-2
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
··· 1186 1186 return; 1187 1187 1188 1188 smp_mb(); 1189 - spin_lock(&adapter->tx_clean_lock); 1190 1189 netif_carrier_off(netdev); 1191 1190 netif_tx_disable(netdev); 1192 1191 ··· 1203 1204 netxen_napi_disable(adapter); 1204 1205 1205 1206 netxen_release_tx_buffers(adapter); 1206 - spin_unlock(&adapter->tx_clean_lock); 1207 1207 } 1208 1208 1209 1209 /* Usage: During suspend and firmware recovery module */
+2 -3
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
··· 1177 1177 { 1178 1178 u32 idc_params, val; 1179 1179 1180 - if (qlcnic_83xx_lockless_flash_read32(adapter, 1181 - QLC_83XX_IDC_FLASH_PARAM_ADDR, 1182 - (u8 *)&idc_params, 1)) { 1180 + if (qlcnic_83xx_flash_read32(adapter, QLC_83XX_IDC_FLASH_PARAM_ADDR, 1181 + (u8 *)&idc_params, 1)) { 1183 1182 dev_info(&adapter->pdev->dev, 1184 1183 "%s:failed to get IDC params from flash\n", __func__); 1185 1184 adapter->dev_init_timeo = QLC_83XX_IDC_INIT_TIMEOUT_SECS;
+5 -5
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
··· 1333 1333 struct qlcnic_host_tx_ring *tx_ring; 1334 1334 struct qlcnic_esw_statistics port_stats; 1335 1335 struct qlcnic_mac_statistics mac_stats; 1336 - int index, ret, length, size, tx_size, ring; 1336 + int index, ret, length, size, ring; 1337 1337 char *p; 1338 1338 1339 - tx_size = adapter->drv_tx_rings * QLCNIC_TX_STATS_LEN; 1339 + memset(data, 0, stats->n_stats * sizeof(u64)); 1340 1340 1341 - memset(data, 0, tx_size * sizeof(u64)); 1342 1341 for (ring = 0, index = 0; ring < adapter->drv_tx_rings; ring++) { 1343 - if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) { 1342 + if (adapter->is_up == QLCNIC_ADAPTER_UP_MAGIC) { 1344 1343 tx_ring = &adapter->tx_ring[ring]; 1345 1344 data = qlcnic_fill_tx_queue_stats(data, tx_ring); 1346 1345 qlcnic_update_stats(adapter); 1346 + } else { 1347 + data += QLCNIC_TX_STATS_LEN; 1347 1348 } 1348 1349 } 1349 1350 1350 - memset(data, 0, stats->n_stats * sizeof(u64)); 1351 1351 length = QLCNIC_STATS_LEN; 1352 1352 for (index = 0; index < length; index++) { 1353 1353 p = (char *)adapter + qlcnic_gstrings_stats[index].stat_offset;
+9 -2
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 2786 2786 if (IS_ERR(priv->stmmac_clk)) { 2787 2787 dev_warn(priv->device, "%s: warning: cannot get CSR clock\n", 2788 2788 __func__); 2789 - ret = PTR_ERR(priv->stmmac_clk); 2790 - goto error_clk_get; 2789 + /* If failed to obtain stmmac_clk and specific clk_csr value 2790 + * is NOT passed from the platform, probe fail. 2791 + */ 2792 + if (!priv->plat->clk_csr) { 2793 + ret = PTR_ERR(priv->stmmac_clk); 2794 + goto error_clk_get; 2795 + } else { 2796 + priv->stmmac_clk = NULL; 2797 + } 2791 2798 } 2792 2799 clk_prepare_enable(priv->stmmac_clk); 2793 2800
+2 -1
drivers/net/hyperv/netvsc_drv.c
··· 387 387 int hdr_offset; 388 388 u32 net_trans_info; 389 389 u32 hash; 390 + u32 skb_length = skb->len; 390 391 391 392 392 393 /* We will atmost need two pages to describe the rndis ··· 563 562 564 563 drop: 565 564 if (ret == 0) { 566 - net->stats.tx_bytes += skb->len; 565 + net->stats.tx_bytes += skb_length; 567 566 net->stats.tx_packets++; 568 567 } else { 569 568 kfree(packet);
+8 -10
drivers/net/macvtap.c
··· 112 112 return err; 113 113 } 114 114 115 + /* Requires RTNL */ 115 116 static int macvtap_set_queue(struct net_device *dev, struct file *file, 116 117 struct macvtap_queue *q) 117 118 { 118 119 struct macvlan_dev *vlan = netdev_priv(dev); 119 - int err = -EBUSY; 120 120 121 - rtnl_lock(); 122 121 if (vlan->numqueues == MAX_MACVTAP_QUEUES) 123 - goto out; 122 + return -EBUSY; 124 123 125 - err = 0; 126 124 rcu_assign_pointer(q->vlan, vlan); 127 125 rcu_assign_pointer(vlan->taps[vlan->numvtaps], q); 128 126 sock_hold(&q->sk); ··· 134 136 vlan->numvtaps++; 135 137 vlan->numqueues++; 136 138 137 - out: 138 - rtnl_unlock(); 139 - return err; 139 + return 0; 140 140 } 141 141 142 142 static int macvtap_disable_queue(struct macvtap_queue *q) ··· 450 454 static int macvtap_open(struct inode *inode, struct file *file) 451 455 { 452 456 struct net *net = current->nsproxy->net_ns; 453 - struct net_device *dev = dev_get_by_macvtap_minor(iminor(inode)); 457 + struct net_device *dev; 454 458 struct macvtap_queue *q; 455 - int err; 459 + int err = -ENODEV; 456 460 457 - err = -ENODEV; 461 + rtnl_lock(); 462 + dev = dev_get_by_macvtap_minor(iminor(inode)); 458 463 if (!dev) 459 464 goto out; 460 465 ··· 495 498 if (dev) 496 499 dev_put(dev); 497 500 501 + rtnl_unlock(); 498 502 return err; 499 503 } 500 504
+42 -46
drivers/net/usb/r8152.c
··· 24 24 #include <net/ip6_checksum.h> 25 25 26 26 /* Version Information */ 27 - #define DRIVER_VERSION "v1.06.0 (2014/03/03)" 27 + #define DRIVER_VERSION "v1.06.1 (2014/10/01)" 28 28 #define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" 29 29 #define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters" 30 30 #define MODULENAME "r8152" ··· 1949 1949 ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data); 1950 1950 } 1951 1951 1952 + static int rtl_start_rx(struct r8152 *tp) 1953 + { 1954 + int i, ret = 0; 1955 + 1956 + INIT_LIST_HEAD(&tp->rx_done); 1957 + for (i = 0; i < RTL8152_MAX_RX; i++) { 1958 + INIT_LIST_HEAD(&tp->rx_info[i].list); 1959 + ret = r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL); 1960 + if (ret) 1961 + break; 1962 + } 1963 + 1964 + return ret; 1965 + } 1966 + 1967 + static int rtl_stop_rx(struct r8152 *tp) 1968 + { 1969 + int i; 1970 + 1971 + for (i = 0; i < RTL8152_MAX_RX; i++) 1972 + usb_kill_urb(tp->rx_info[i].urb); 1973 + 1974 + return 0; 1975 + } 1976 + 1952 1977 static int rtl_enable(struct r8152 *tp) 1953 1978 { 1954 1979 u32 ocp_data; 1955 - int i, ret; 1956 1980 1957 1981 r8152b_reset_packet_filter(tp); 1958 1982 ··· 1986 1962 1987 1963 rxdy_gated_en(tp, false); 1988 1964 1989 - INIT_LIST_HEAD(&tp->rx_done); 1990 - ret = 0; 1991 - for (i = 0; i < RTL8152_MAX_RX; i++) { 1992 - INIT_LIST_HEAD(&tp->rx_info[i].list); 1993 - ret |= r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL); 1994 - } 1995 - 1996 - return ret; 1965 + return rtl_start_rx(tp); 1997 1966 } 1998 1967 1999 1968 static int rtl8152_enable(struct r8152 *tp) ··· 2070 2053 mdelay(1); 2071 2054 } 2072 2055 2073 - for (i = 0; i < RTL8152_MAX_RX; i++) 2074 - usb_kill_urb(tp->rx_info[i].urb); 2056 + rtl_stop_rx(tp); 2075 2057 2076 2058 rtl8152_nic_reset(tp); 2077 2059 } ··· 2201 2185 } 2202 2186 } 2203 2187 2204 - static void rtl_clear_bp(struct r8152 *tp) 2205 - { 2206 - ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_0, 0); 2207 - ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_2, 0); 2208 - ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_4, 0); 2209 - ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_6, 0); 2210 - ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_0, 0); 2211 - ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_2, 0); 2212 - ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_4, 0); 2213 - ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_6, 0); 2214 - mdelay(3); 2215 - ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_BA, 0); 2216 - ocp_write_word(tp, MCU_TYPE_USB, USB_BP_BA, 0); 2217 - } 2218 - 2219 - static void r8153_clear_bp(struct r8152 *tp) 2220 - { 2221 - ocp_write_byte(tp, MCU_TYPE_PLA, PLA_BP_EN, 0); 2222 - ocp_write_byte(tp, MCU_TYPE_USB, USB_BP_EN, 0); 2223 - rtl_clear_bp(tp); 2224 - } 2225 - 2226 2188 static void r8153_teredo_off(struct r8152 *tp) 2227 2189 { 2228 2190 u32 ocp_data; ··· 2242 2248 data &= ~BMCR_PDOWN; 2243 2249 r8152_mdio_write(tp, MII_BMCR, data); 2244 2250 } 2245 - 2246 - rtl_clear_bp(tp); 2247 2251 2248 2252 set_bit(PHY_RESET, &tp->flags); 2249 2253 } ··· 2392 2400 data &= ~BMCR_PDOWN; 2393 2401 r8152_mdio_write(tp, MII_BMCR, data); 2394 2402 } 2395 - 2396 - r8153_clear_bp(tp); 2397 2403 2398 2404 if (tp->version == RTL_VER_03) { 2399 2405 data = ocp_reg_read(tp, OCP_EEE_CFG); ··· 3073 3083 clear_bit(WORK_ENABLE, &tp->flags); 3074 3084 usb_kill_urb(tp->intr_urb); 3075 3085 cancel_delayed_work_sync(&tp->schedule); 3086 + tasklet_disable(&tp->tl); 3076 3087 if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { 3088 + rtl_stop_rx(tp); 3077 3089 rtl_runtime_suspend_enable(tp, true); 3078 3090 } else { 3079 - tasklet_disable(&tp->tl); 3080 3091 tp->rtl_ops.down(tp); 3081 - tasklet_enable(&tp->tl); 3082 3092 } 3093 + tasklet_enable(&tp->tl); 3083 3094 } 3084 3095 3085 3096 return 0; ··· 3099 3108 if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { 3100 3109 rtl_runtime_suspend_enable(tp, false); 3101 3110 clear_bit(SELECTIVE_SUSPEND, &tp->flags); 3111 + set_bit(WORK_ENABLE, &tp->flags); 3102 3112 if (tp->speed & LINK_STATUS) 3103 - tp->rtl_ops.disable(tp); 3113 + rtl_start_rx(tp); 3104 3114 } else { 3105 3115 tp->rtl_ops.up(tp); 3106 3116 rtl8152_set_speed(tp, AUTONEG_ENABLE, 3107 3117 tp->mii.supports_gmii ? SPEED_1000 : SPEED_100, 3108 3118 DUPLEX_FULL); 3119 + tp->speed = 0; 3120 + netif_carrier_off(tp->netdev); 3121 + set_bit(WORK_ENABLE, &tp->flags); 3109 3122 } 3110 - tp->speed = 0; 3111 - netif_carrier_off(tp->netdev); 3112 - set_bit(WORK_ENABLE, &tp->flags); 3113 3123 usb_submit_urb(tp->intr_urb, GFP_KERNEL); 3114 3124 } 3115 3125 ··· 3397 3405 if (test_bit(RTL8152_UNPLUG, &tp->flags)) 3398 3406 return; 3399 3407 3400 - r8153_power_cut_en(tp, true); 3408 + r8153_power_cut_en(tp, false); 3401 3409 } 3402 3410 3403 3411 static int rtl_ops_init(struct r8152 *tp, const struct usb_device_id *id) ··· 3550 3558 3551 3559 usb_set_intfdata(intf, NULL); 3552 3560 if (tp) { 3553 - set_bit(RTL8152_UNPLUG, &tp->flags); 3561 + struct usb_device *udev = tp->udev; 3562 + 3563 + if (udev->state == USB_STATE_NOTATTACHED) 3564 + set_bit(RTL8152_UNPLUG, &tp->flags); 3565 + 3554 3566 tasklet_kill(&tp->tl); 3555 3567 unregister_netdev(tp->netdev); 3556 3568 tp->rtl_ops.unload(tp);
+1 -4
include/net/ip6_fib.h
··· 114 114 u32 rt6i_flags; 115 115 struct rt6key rt6i_src; 116 116 struct rt6key rt6i_prefsrc; 117 - u32 rt6i_metric; 118 117 119 118 struct inet6_dev *rt6i_idev; 120 119 unsigned long _rt6i_peer; 121 120 122 - u32 rt6i_genid; 123 - 121 + u32 rt6i_metric; 124 122 /* more non-fragment space at head required */ 125 123 unsigned short rt6i_nfheader_len; 126 - 127 124 u8 rt6i_protocol; 128 125 }; 129 126
+3 -17
include/net/net_namespace.h
··· 352 352 atomic_inc(&net->ipv4.rt_genid); 353 353 } 354 354 355 - #if IS_ENABLED(CONFIG_IPV6) 356 - static inline int rt_genid_ipv6(struct net *net) 357 - { 358 - return atomic_read(&net->ipv6.rt_genid); 359 - } 360 - 355 + extern void (*__fib6_flush_trees)(struct net *net); 361 356 static inline void rt_genid_bump_ipv6(struct net *net) 362 357 { 363 - atomic_inc(&net->ipv6.rt_genid); 358 + if (__fib6_flush_trees) 359 + __fib6_flush_trees(net); 364 360 } 365 - #else 366 - static inline int rt_genid_ipv6(struct net *net) 367 - { 368 - return 0; 369 - } 370 - 371 - static inline void rt_genid_bump_ipv6(struct net *net) 372 - { 373 - } 374 - #endif 375 361 376 362 #if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN) 377 363 static inline struct netns_ieee802154_lowpan *
+4 -4
lib/rhashtable.c
··· 588 588 * rhashtable_destroy - destroy hash table 589 589 * @ht: the hash table to destroy 590 590 * 591 - * Frees the bucket array. 591 + * Frees the bucket array. This function is not rcu safe, therefore the caller 592 + * has to make sure that no resizing may happen by unpublishing the hashtable 593 + * and waiting for the quiescent cycle before releasing the bucket array. 592 594 */ 593 595 void rhashtable_destroy(const struct rhashtable *ht) 594 596 { 595 - const struct bucket_table *tbl = rht_dereference(ht->tbl, ht); 596 - 597 - bucket_table_free(tbl); 597 + bucket_table_free(ht->tbl); 598 598 } 599 599 EXPORT_SYMBOL_GPL(rhashtable_destroy); 600 600
+3
net/core/skbuff.c
··· 3152 3152 NAPI_GRO_CB(skb)->free = NAPI_GRO_FREE_STOLEN_HEAD; 3153 3153 goto done; 3154 3154 } 3155 + /* switch back to head shinfo */ 3156 + pinfo = skb_shinfo(p); 3157 + 3155 3158 if (pinfo->frag_list) 3156 3159 goto merge; 3157 3160 if (skb_gro_len(p) != pinfo->gso_size)
+8 -3
net/ipv4/ip_tunnel.c
··· 764 764 765 765 t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type); 766 766 767 - if (!t && (cmd == SIOCADDTUNNEL)) { 768 - t = ip_tunnel_create(net, itn, p); 769 - err = PTR_ERR_OR_ZERO(t); 767 + if (cmd == SIOCADDTUNNEL) { 768 + if (!t) { 769 + t = ip_tunnel_create(net, itn, p); 770 + err = PTR_ERR_OR_ZERO(t); 771 + break; 772 + } 773 + 774 + err = -EEXIST; 770 775 break; 771 776 } 772 777 if (dev != itn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) {
+1 -1
net/ipv4/route.c
··· 746 746 } 747 747 748 748 n = ipv4_neigh_lookup(&rt->dst, NULL, &new_gw); 749 - if (n) { 749 + if (!IS_ERR(n)) { 750 750 if (!(n->nud_state & NUD_VALID)) { 751 751 neigh_event_send(n, NULL); 752 752 } else {
+2 -1
net/ipv6/addrconf.c
··· 4780 4780 4781 4781 if (ip6_del_rt(ifp->rt)) 4782 4782 dst_free(&ifp->rt->dst); 4783 + 4784 + rt_genid_bump_ipv6(net); 4783 4785 break; 4784 4786 } 4785 4787 atomic_inc(&net->ipv6.dev_addr_genid); 4786 - rt_genid_bump_ipv6(net); 4787 4788 } 4788 4789 4789 4790 static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
+7
net/ipv6/addrconf_core.c
··· 8 8 #include <net/addrconf.h> 9 9 #include <net/ip.h> 10 10 11 + /* if ipv6 module registers this function is used by xfrm to force all 12 + * sockets to relookup their nodes - this is fairly expensive, be 13 + * careful 14 + */ 15 + void (*__fib6_flush_trees)(struct net *); 16 + EXPORT_SYMBOL(__fib6_flush_trees); 17 + 11 18 #define IPV6_ADDR_SCOPE_TYPE(scope) ((scope) << 16) 12 19 13 20 static inline unsigned int ipv6_addr_scope2type(unsigned int scope)
+20
net/ipv6/ip6_fib.c
··· 1605 1605 fib6_clean_tree(net, fn, fib6_prune_clone, 1, NULL); 1606 1606 } 1607 1607 1608 + static int fib6_update_sernum(struct rt6_info *rt, void *arg) 1609 + { 1610 + __u32 sernum = *(__u32 *)arg; 1611 + 1612 + if (rt->rt6i_node && 1613 + rt->rt6i_node->fn_sernum != sernum) 1614 + rt->rt6i_node->fn_sernum = sernum; 1615 + 1616 + return 0; 1617 + } 1618 + 1619 + static void fib6_flush_trees(struct net *net) 1620 + { 1621 + __u32 new_sernum = fib6_new_sernum(); 1622 + 1623 + fib6_clean_all(net, fib6_update_sernum, &new_sernum); 1624 + } 1625 + 1608 1626 /* 1609 1627 * Garbage collection 1610 1628 */ ··· 1806 1788 NULL); 1807 1789 if (ret) 1808 1790 goto out_unregister_subsys; 1791 + 1792 + __fib6_flush_trees = fib6_flush_trees; 1809 1793 out: 1810 1794 return ret; 1811 1795
+3
net/ipv6/ip6_gre.c
··· 314 314 struct ip6gre_net *ign = net_generic(net, ip6gre_net_id); 315 315 316 316 t = ip6gre_tunnel_find(net, parms, ARPHRD_IP6GRE); 317 + if (t && create) 318 + return NULL; 317 319 if (t || !create) 318 320 return t; 319 321 ··· 1726 1724 MODULE_AUTHOR("D. Kozlov (xeb@mail.ru)"); 1727 1725 MODULE_DESCRIPTION("GRE over IPv6 tunneling device"); 1728 1726 MODULE_ALIAS_RTNL_LINK("ip6gre"); 1727 + MODULE_ALIAS_RTNL_LINK("ip6gretap"); 1729 1728 MODULE_ALIAS_NETDEV("ip6gre0");
+5 -1
net/ipv6/ip6_tunnel.c
··· 364 364 (t = rtnl_dereference(*tp)) != NULL; 365 365 tp = &t->next) { 366 366 if (ipv6_addr_equal(local, &t->parms.laddr) && 367 - ipv6_addr_equal(remote, &t->parms.raddr)) 367 + ipv6_addr_equal(remote, &t->parms.raddr)) { 368 + if (create) 369 + return NULL; 370 + 368 371 return t; 372 + } 369 373 } 370 374 if (!create) 371 375 return NULL;
+5 -1
net/ipv6/ip6_vti.c
··· 253 253 (t = rtnl_dereference(*tp)) != NULL; 254 254 tp = &t->next) { 255 255 if (ipv6_addr_equal(local, &t->parms.laddr) && 256 - ipv6_addr_equal(remote, &t->parms.raddr)) 256 + ipv6_addr_equal(remote, &t->parms.raddr)) { 257 + if (create) 258 + return NULL; 259 + 257 260 return t; 261 + } 258 262 } 259 263 if (!create) 260 264 return NULL;
-4
net/ipv6/route.c
··· 314 314 315 315 memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); 316 316 rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers); 317 - rt->rt6i_genid = rt_genid_ipv6(net); 318 317 INIT_LIST_HEAD(&rt->rt6i_siblings); 319 318 } 320 319 return rt; ··· 1097 1098 * DST_OBSOLETE_FORCE_CHK which forces validation calls down 1098 1099 * into this function always. 1099 1100 */ 1100 - if (rt->rt6i_genid != rt_genid_ipv6(dev_net(rt->dst.dev))) 1101 - return NULL; 1102 - 1103 1101 if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie)) 1104 1102 return NULL; 1105 1103
+1
net/netfilter/Kconfig
··· 847 847 tristate '"TPROXY" target transparent proxying support' 848 848 depends on NETFILTER_XTABLES 849 849 depends on NETFILTER_ADVANCED 850 + depends on (IPV6 || IPV6=n) 850 851 depends on IP_NF_MANGLE 851 852 select NF_DEFRAG_IPV4 852 853 select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES
+63 -1
net/netfilter/nfnetlink.c
··· 222 222 } 223 223 } 224 224 225 + struct nfnl_err { 226 + struct list_head head; 227 + struct nlmsghdr *nlh; 228 + int err; 229 + }; 230 + 231 + static int nfnl_err_add(struct list_head *list, struct nlmsghdr *nlh, int err) 232 + { 233 + struct nfnl_err *nfnl_err; 234 + 235 + nfnl_err = kmalloc(sizeof(struct nfnl_err), GFP_KERNEL); 236 + if (nfnl_err == NULL) 237 + return -ENOMEM; 238 + 239 + nfnl_err->nlh = nlh; 240 + nfnl_err->err = err; 241 + list_add_tail(&nfnl_err->head, list); 242 + 243 + return 0; 244 + } 245 + 246 + static void nfnl_err_del(struct nfnl_err *nfnl_err) 247 + { 248 + list_del(&nfnl_err->head); 249 + kfree(nfnl_err); 250 + } 251 + 252 + static void nfnl_err_reset(struct list_head *err_list) 253 + { 254 + struct nfnl_err *nfnl_err, *next; 255 + 256 + list_for_each_entry_safe(nfnl_err, next, err_list, head) 257 + nfnl_err_del(nfnl_err); 258 + } 259 + 260 + static void nfnl_err_deliver(struct list_head *err_list, struct sk_buff *skb) 261 + { 262 + struct nfnl_err *nfnl_err, *next; 263 + 264 + list_for_each_entry_safe(nfnl_err, next, err_list, head) { 265 + netlink_ack(skb, nfnl_err->nlh, nfnl_err->err); 266 + nfnl_err_del(nfnl_err); 267 + } 268 + } 269 + 225 270 static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh, 226 271 u_int16_t subsys_id) 227 272 { ··· 275 230 const struct nfnetlink_subsystem *ss; 276 231 const struct nfnl_callback *nc; 277 232 bool success = true, done = false; 233 + static LIST_HEAD(err_list); 278 234 int err; 279 235 280 236 if (subsys_id >= NFNL_SUBSYS_COUNT) ··· 333 287 type = nlh->nlmsg_type; 334 288 if (type == NFNL_MSG_BATCH_BEGIN) { 335 289 /* Malformed: Batch begin twice */ 290 + nfnl_err_reset(&err_list); 336 291 success = false; 337 292 goto done; 338 293 } else if (type == NFNL_MSG_BATCH_END) { ··· 380 333 * original skb. 381 334 */ 382 335 if (err == -EAGAIN) { 336 + nfnl_err_reset(&err_list); 383 337 ss->abort(skb); 384 338 nfnl_unlock(subsys_id); 385 339 kfree_skb(nskb); ··· 389 341 } 390 342 ack: 391 343 if (nlh->nlmsg_flags & NLM_F_ACK || err) { 344 + /* Errors are delivered once the full batch has been 345 + * processed, this avoids that the same error is 346 + * reported several times when replaying the batch. 347 + */ 348 + if (nfnl_err_add(&err_list, nlh, err) < 0) { 349 + /* We failed to enqueue an error, reset the 350 + * list of errors and send OOM to userspace 351 + * pointing to the batch header. 352 + */ 353 + nfnl_err_reset(&err_list); 354 + netlink_ack(skb, nlmsg_hdr(oskb), -ENOMEM); 355 + success = false; 356 + goto done; 357 + } 392 358 /* We don't stop processing the batch on errors, thus, 393 359 * userspace gets all the errors that the batch 394 360 * triggers. 395 361 */ 396 - netlink_ack(skb, nlh, err); 397 362 if (err) 398 363 success = false; 399 364 } ··· 422 361 else 423 362 ss->abort(skb); 424 363 364 + nfnl_err_deliver(&err_list, oskb); 425 365 nfnl_unlock(subsys_id); 426 366 kfree_skb(nskb); 427 367 }
+7 -5
net/netfilter/nft_hash.c
··· 180 180 static void nft_hash_destroy(const struct nft_set *set) 181 181 { 182 182 const struct rhashtable *priv = nft_set_priv(set); 183 - const struct bucket_table *tbl; 183 + const struct bucket_table *tbl = priv->tbl; 184 184 struct nft_hash_elem *he, *next; 185 185 unsigned int i; 186 186 187 - tbl = rht_dereference(priv->tbl, priv); 188 - for (i = 0; i < tbl->size; i++) 189 - rht_for_each_entry_safe(he, next, tbl->buckets[i], priv, node) 187 + for (i = 0; i < tbl->size; i++) { 188 + for (he = rht_entry(tbl->buckets[i], struct nft_hash_elem, node); 189 + he != NULL; he = next) { 190 + next = rht_entry(he->node.next, struct nft_hash_elem, node); 190 191 nft_hash_elem_destroy(set, he); 191 - 192 + } 193 + } 192 194 rhashtable_destroy(priv); 193 195 } 194 196
-2
net/netfilter/nft_rbtree.c
··· 234 234 struct nft_rbtree_elem *rbe; 235 235 struct rb_node *node; 236 236 237 - spin_lock_bh(&nft_rbtree_lock); 238 237 while ((node = priv->root.rb_node) != NULL) { 239 238 rb_erase(node, &priv->root); 240 239 rbe = rb_entry(node, struct nft_rbtree_elem, node); 241 240 nft_rbtree_elem_destroy(set, rbe); 242 241 } 243 - spin_unlock_bh(&nft_rbtree_lock); 244 242 } 245 243 246 244 static bool nft_rbtree_estimate(const struct nft_set_desc *desc, u32 features,
+4 -2
net/sched/ematch.c
··· 526 526 match_idx = stack[--stackp]; 527 527 cur_match = tcf_em_get_match(tree, match_idx); 528 528 529 - if (tcf_em_early_end(cur_match, res)) 529 + if (tcf_em_early_end(cur_match, res)) { 530 + if (tcf_em_is_inverted(cur_match)) 531 + res = !res; 530 532 goto pop_stack; 531 - else { 533 + } else { 532 534 match_idx++; 533 535 goto proceed; 534 536 }