aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/networking/ax25.txt18
-rw-r--r--MAINTAINERS3
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c6
-rw-r--r--drivers/net/ppp_generic.c3
-rw-r--r--drivers/net/sungem.c30
-rw-r--r--drivers/net/tg3.c134
-rw-r--r--drivers/net/tg3.h5
-rw-r--r--drivers/net/wan/lmc/lmc_media.h65
-rw-r--r--include/net/fib_rules.h1
-rw-r--r--include/net/ip6_fib.h1
-rw-r--r--include/net/neighbour.h2
-rw-r--r--net/atm/clip.c9
-rw-r--r--net/ax25/Kconfig61
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/fib_rules.c30
-rw-r--r--net/core/neighbour.c14
-rw-r--r--net/dccp/dccp.h1
-rw-r--r--net/dccp/timer.c2
-rw-r--r--net/decnet/dn_fib.c5
-rw-r--r--net/decnet/dn_rules.c13
-rw-r--r--net/ipv4/fib_frontend.c5
-rw-r--r--net/ipv4/fib_rules.c14
-rw-r--r--net/ipv4/fib_semantics.c2
-rw-r--r--net/ipv4/fib_trie.c9
-rw-r--r--net/ipv6/fib6_rules.c14
-rw-r--r--net/ipv6/ip6_fib.c8
-rw-r--r--net/ipv6/route.c97
-rw-r--r--net/sched/cls_basic.c16
-rw-r--r--net/socket.c7
29 files changed, 313 insertions, 266 deletions
diff --git a/Documentation/networking/ax25.txt b/Documentation/networking/ax25.txt
index 37c25b0925f0..8257dbf9be57 100644
--- a/Documentation/networking/ax25.txt
+++ b/Documentation/networking/ax25.txt
@@ -1,16 +1,10 @@
1To use the amateur radio protocols within Linux you will need to get a 1To use the amateur radio protocols within Linux you will need to get a
2suitable copy of the AX.25 Utilities. More detailed information about these 2suitable copy of the AX.25 Utilities. More detailed information about
3and associated programs can be found on http://zone.pspt.fi/~jsn/. 3AX.25, NET/ROM and ROSE, associated programs and and utilities can be
4 4found on http://www.linux-ax25.org.
5For more information about the AX.25, NET/ROM and ROSE protocol stacks, see
6the AX25-HOWTO written by Terry Dawson <terry@perf.no.itg.telstra.com.au>
7who is also the AX.25 Utilities maintainer.
8 5
9There is an active mailing list for discussing Linux amateur radio matters 6There is an active mailing list for discussing Linux amateur radio matters
10called linux-hams. To subscribe to it, send a message to 7called linux-hams@vger.kernel.org. To subscribe to it, send a message to
11majordomo@vger.kernel.org with the words "subscribe linux-hams" in the body 8majordomo@vger.kernel.org with the words "subscribe linux-hams" in the body
12of the message, the subject field is ignored. 9of the message, the subject field is ignored. You don't need to be
13 10subscribed to post but of course that means you might miss an answer.
14Jonathan G4KLX
15
16g4klx@g4klx.demon.co.uk
diff --git a/MAINTAINERS b/MAINTAINERS
index dd6978b1e8fb..2524323671b0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2928,9 +2928,12 @@ L: linux-scsi@vger.kernel.org
2928S: Maintained 2928S: Maintained
2929 2929
2930SCTP PROTOCOL 2930SCTP PROTOCOL
2931P: Vlad Yasevich
2932M: vladislav.yasevich@hp.com
2931P: Sridhar Samudrala 2933P: Sridhar Samudrala
2932M: sri@us.ibm.com 2934M: sri@us.ibm.com
2933L: lksctp-developers@lists.sourceforge.net 2935L: lksctp-developers@lists.sourceforge.net
2936W: http://lksctp.sourceforge.net
2934S: Supported 2937S: Supported
2935 2938
2936SCx200 CPU SUPPORT 2939SCx200 CPU SUPPORT
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 0741c6d1337c..f2a40ae8e7d0 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -814,7 +814,7 @@ static void ipoib_set_mcast_list(struct net_device *dev)
814 queue_work(ipoib_workqueue, &priv->restart_task); 814 queue_work(ipoib_workqueue, &priv->restart_task);
815} 815}
816 816
817static void ipoib_neigh_destructor(struct neighbour *n) 817static void ipoib_neigh_cleanup(struct neighbour *n)
818{ 818{
819 struct ipoib_neigh *neigh; 819 struct ipoib_neigh *neigh;
820 struct ipoib_dev_priv *priv = netdev_priv(n->dev); 820 struct ipoib_dev_priv *priv = netdev_priv(n->dev);
@@ -822,7 +822,7 @@ static void ipoib_neigh_destructor(struct neighbour *n)
822 struct ipoib_ah *ah = NULL; 822 struct ipoib_ah *ah = NULL;
823 823
824 ipoib_dbg(priv, 824 ipoib_dbg(priv,
825 "neigh_destructor for %06x " IPOIB_GID_FMT "\n", 825 "neigh_cleanup for %06x " IPOIB_GID_FMT "\n",
826 IPOIB_QPN(n->ha), 826 IPOIB_QPN(n->ha),
827 IPOIB_GID_RAW_ARG(n->ha + 4)); 827 IPOIB_GID_RAW_ARG(n->ha + 4));
828 828
@@ -874,7 +874,7 @@ void ipoib_neigh_free(struct net_device *dev, struct ipoib_neigh *neigh)
874 874
875static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms) 875static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms)
876{ 876{
877 parms->neigh_destructor = ipoib_neigh_destructor; 877 parms->neigh_cleanup = ipoib_neigh_cleanup;
878 878
879 return 0; 879 return 0;
880} 880}
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 11b575f89856..ef58e4128782 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -2544,6 +2544,9 @@ static void ppp_destroy_interface(struct ppp *ppp)
2544 ppp->active_filter = NULL; 2544 ppp->active_filter = NULL;
2545#endif /* CONFIG_PPP_FILTER */ 2545#endif /* CONFIG_PPP_FILTER */
2546 2546
2547 if (ppp->xmit_pending)
2548 kfree_skb(ppp->xmit_pending);
2549
2547 kfree(ppp); 2550 kfree(ppp);
2548} 2551}
2549 2552
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 616be8d0fa85..08ea61db46fe 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2530,6 +2530,35 @@ static struct net_device_stats *gem_get_stats(struct net_device *dev)
2530 return &gp->net_stats; 2530 return &gp->net_stats;
2531} 2531}
2532 2532
2533static int gem_set_mac_address(struct net_device *dev, void *addr)
2534{
2535 struct sockaddr *macaddr = (struct sockaddr *) addr;
2536 struct gem *gp = dev->priv;
2537 unsigned char *e = &dev->dev_addr[0];
2538
2539 if (!is_valid_ether_addr(macaddr->sa_data))
2540 return -EADDRNOTAVAIL;
2541
2542 if (!netif_running(dev) || !netif_device_present(dev)) {
2543 /* We'll just catch it later when the
2544 * device is up'd or resumed.
2545 */
2546 memcpy(dev->dev_addr, macaddr->sa_data, dev->addr_len);
2547 return 0;
2548 }
2549
2550 mutex_lock(&gp->pm_mutex);
2551 memcpy(dev->dev_addr, macaddr->sa_data, dev->addr_len);
2552 if (gp->running) {
2553 writel((e[4] << 8) | e[5], gp->regs + MAC_ADDR0);
2554 writel((e[2] << 8) | e[3], gp->regs + MAC_ADDR1);
2555 writel((e[0] << 8) | e[1], gp->regs + MAC_ADDR2);
2556 }
2557 mutex_unlock(&gp->pm_mutex);
2558
2559 return 0;
2560}
2561
2533static void gem_set_multicast(struct net_device *dev) 2562static void gem_set_multicast(struct net_device *dev)
2534{ 2563{
2535 struct gem *gp = dev->priv; 2564 struct gem *gp = dev->priv;
@@ -3122,6 +3151,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
3122 dev->change_mtu = gem_change_mtu; 3151 dev->change_mtu = gem_change_mtu;
3123 dev->irq = pdev->irq; 3152 dev->irq = pdev->irq;
3124 dev->dma = 0; 3153 dev->dma = 0;
3154 dev->set_mac_address = gem_set_mac_address;
3125#ifdef CONFIG_NET_POLL_CONTROLLER 3155#ifdef CONFIG_NET_POLL_CONTROLLER
3126 dev->poll_controller = gem_poll_controller; 3156 dev->poll_controller = gem_poll_controller;
3127#endif 3157#endif
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 8c8f9f4d47a5..0acee9f324e9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.74" 67#define DRV_MODULE_VERSION "3.75"
68#define DRV_MODULE_RELDATE "February 20, 2007" 68#define DRV_MODULE_RELDATE "March 23, 2007"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -3568,32 +3568,34 @@ static irqreturn_t tg3_interrupt(int irq, void *dev_id)
3568 * Reading the PCI State register will confirm whether the 3568 * Reading the PCI State register will confirm whether the
3569 * interrupt is ours and will flush the status block. 3569 * interrupt is ours and will flush the status block.
3570 */ 3570 */
3571 if ((sblk->status & SD_STATUS_UPDATED) || 3571 if (unlikely(!(sblk->status & SD_STATUS_UPDATED))) {
3572 !(tr32(TG3PCI_PCISTATE) & PCISTATE_INT_NOT_ACTIVE)) { 3572 if ((tp->tg3_flags & TG3_FLAG_CHIP_RESETTING) ||
3573 /* 3573 (tr32(TG3PCI_PCISTATE) & PCISTATE_INT_NOT_ACTIVE)) {
3574 * Writing any value to intr-mbox-0 clears PCI INTA# and 3574 handled = 0;
3575 * chip-internal interrupt pending events.
3576 * Writing non-zero to intr-mbox-0 additional tells the
3577 * NIC to stop sending us irqs, engaging "in-intr-handler"
3578 * event coalescing.
3579 */
3580 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
3581 0x00000001);
3582 if (tg3_irq_sync(tp))
3583 goto out; 3575 goto out;
3584 sblk->status &= ~SD_STATUS_UPDATED;
3585 if (likely(tg3_has_work(tp))) {
3586 prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
3587 netif_rx_schedule(dev); /* schedule NAPI poll */
3588 } else {
3589 /* No work, shared interrupt perhaps? re-enable
3590 * interrupts, and flush that PCI write
3591 */
3592 tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
3593 0x00000000);
3594 } 3576 }
3595 } else { /* shared interrupt */ 3577 }
3596 handled = 0; 3578
3579 /*
3580 * Writing any value to intr-mbox-0 clears PCI INTA# and
3581 * chip-internal interrupt pending events.
3582 * Writing non-zero to intr-mbox-0 additional tells the
3583 * NIC to stop sending us irqs, engaging "in-intr-handler"
3584 * event coalescing.
3585 */
3586 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
3587 if (tg3_irq_sync(tp))
3588 goto out;
3589 sblk->status &= ~SD_STATUS_UPDATED;
3590 if (likely(tg3_has_work(tp))) {
3591 prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
3592 netif_rx_schedule(dev); /* schedule NAPI poll */
3593 } else {
3594 /* No work, shared interrupt perhaps? re-enable
3595 * interrupts, and flush that PCI write
3596 */
3597 tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
3598 0x00000000);
3597 } 3599 }
3598out: 3600out:
3599 return IRQ_RETVAL(handled); 3601 return IRQ_RETVAL(handled);
@@ -3611,31 +3613,33 @@ static irqreturn_t tg3_interrupt_tagged(int irq, void *dev_id)
3611 * Reading the PCI State register will confirm whether the 3613 * Reading the PCI State register will confirm whether the
3612 * interrupt is ours and will flush the status block. 3614 * interrupt is ours and will flush the status block.
3613 */ 3615 */
3614 if ((sblk->status_tag != tp->last_tag) || 3616 if (unlikely(sblk->status_tag == tp->last_tag)) {
3615 !(tr32(TG3PCI_PCISTATE) & PCISTATE_INT_NOT_ACTIVE)) { 3617 if ((tp->tg3_flags & TG3_FLAG_CHIP_RESETTING) ||
3616 /* 3618 (tr32(TG3PCI_PCISTATE) & PCISTATE_INT_NOT_ACTIVE)) {
3617 * writing any value to intr-mbox-0 clears PCI INTA# and 3619 handled = 0;
3618 * chip-internal interrupt pending events.
3619 * writing non-zero to intr-mbox-0 additional tells the
3620 * NIC to stop sending us irqs, engaging "in-intr-handler"
3621 * event coalescing.
3622 */
3623 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
3624 0x00000001);
3625 if (tg3_irq_sync(tp))
3626 goto out; 3620 goto out;
3627 if (netif_rx_schedule_prep(dev)) {
3628 prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
3629 /* Update last_tag to mark that this status has been
3630 * seen. Because interrupt may be shared, we may be
3631 * racing with tg3_poll(), so only update last_tag
3632 * if tg3_poll() is not scheduled.
3633 */
3634 tp->last_tag = sblk->status_tag;
3635 __netif_rx_schedule(dev);
3636 } 3621 }
3637 } else { /* shared interrupt */ 3622 }
3638 handled = 0; 3623
3624 /*
3625 * writing any value to intr-mbox-0 clears PCI INTA# and
3626 * chip-internal interrupt pending events.
3627 * writing non-zero to intr-mbox-0 additional tells the
3628 * NIC to stop sending us irqs, engaging "in-intr-handler"
3629 * event coalescing.
3630 */
3631 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
3632 if (tg3_irq_sync(tp))
3633 goto out;
3634 if (netif_rx_schedule_prep(dev)) {
3635 prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
3636 /* Update last_tag to mark that this status has been
3637 * seen. Because interrupt may be shared, we may be
3638 * racing with tg3_poll(), so only update last_tag
3639 * if tg3_poll() is not scheduled.
3640 */
3641 tp->last_tag = sblk->status_tag;
3642 __netif_rx_schedule(dev);
3639 } 3643 }
3640out: 3644out:
3641 return IRQ_RETVAL(handled); 3645 return IRQ_RETVAL(handled);
@@ -4823,6 +4827,19 @@ static int tg3_chip_reset(struct tg3 *tp)
4823 if (write_op == tg3_write_flush_reg32) 4827 if (write_op == tg3_write_flush_reg32)
4824 tp->write32 = tg3_write32; 4828 tp->write32 = tg3_write32;
4825 4829
4830 /* Prevent the irq handler from reading or writing PCI registers
4831 * during chip reset when the memory enable bit in the PCI command
4832 * register may be cleared. The chip does not generate interrupt
4833 * at this time, but the irq handler may still be called due to irq
4834 * sharing or irqpoll.
4835 */
4836 tp->tg3_flags |= TG3_FLAG_CHIP_RESETTING;
4837 tp->hw_status->status = 0;
4838 tp->hw_status->status_tag = 0;
4839 tp->last_tag = 0;
4840 smp_mb();
4841 synchronize_irq(tp->pdev->irq);
4842
4826 /* do the reset */ 4843 /* do the reset */
4827 val = GRC_MISC_CFG_CORECLK_RESET; 4844 val = GRC_MISC_CFG_CORECLK_RESET;
4828 4845
@@ -4904,6 +4921,8 @@ static int tg3_chip_reset(struct tg3 *tp)
4904 4921
4905 pci_restore_state(tp->pdev); 4922 pci_restore_state(tp->pdev);
4906 4923
4924 tp->tg3_flags &= ~TG3_FLAG_CHIP_RESETTING;
4925
4907 /* Make sure PCI-X relaxed ordering bit is clear. */ 4926 /* Make sure PCI-X relaxed ordering bit is clear. */
4908 pci_read_config_dword(tp->pdev, TG3PCI_X_CAPS, &val); 4927 pci_read_config_dword(tp->pdev, TG3PCI_X_CAPS, &val);
4909 val &= ~PCIX_CAPS_RELAXED_ORDERING; 4928 val &= ~PCIX_CAPS_RELAXED_ORDERING;
@@ -6321,8 +6340,6 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
6321 RDMAC_MODE_ADDROFLOW_ENAB | RDMAC_MODE_FIFOOFLOW_ENAB | 6340 RDMAC_MODE_ADDROFLOW_ENAB | RDMAC_MODE_FIFOOFLOW_ENAB |
6322 RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB | 6341 RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB |
6323 RDMAC_MODE_LNGREAD_ENAB); 6342 RDMAC_MODE_LNGREAD_ENAB);
6324 if (tp->tg3_flags & TG3_FLAG_SPLIT_MODE)
6325 rdmac_mode |= RDMAC_MODE_SPLIT_ENABLE;
6326 6343
6327 /* If statement applies to 5705 and 5750 PCI devices only */ 6344 /* If statement applies to 5705 and 5750 PCI devices only */
6328 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 && 6345 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
@@ -6495,9 +6512,6 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
6495 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { 6512 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
6496 val &= ~(PCIX_CAPS_SPLIT_MASK | PCIX_CAPS_BURST_MASK); 6513 val &= ~(PCIX_CAPS_SPLIT_MASK | PCIX_CAPS_BURST_MASK);
6497 val |= (PCIX_CAPS_MAX_BURST_CPIOB << PCIX_CAPS_BURST_SHIFT); 6514 val |= (PCIX_CAPS_MAX_BURST_CPIOB << PCIX_CAPS_BURST_SHIFT);
6498 if (tp->tg3_flags & TG3_FLAG_SPLIT_MODE)
6499 val |= (tp->split_mode_max_reqs <<
6500 PCIX_CAPS_SPLIT_SHIFT);
6501 } 6515 }
6502 tw32(TG3PCI_X_CAPS, val); 6516 tw32(TG3PCI_X_CAPS, val);
6503 } 6517 }
@@ -10863,14 +10877,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10863 grc_misc_cfg = tr32(GRC_MISC_CFG); 10877 grc_misc_cfg = tr32(GRC_MISC_CFG);
10864 grc_misc_cfg &= GRC_MISC_CFG_BOARD_ID_MASK; 10878 grc_misc_cfg &= GRC_MISC_CFG_BOARD_ID_MASK;
10865 10879
10866 /* Broadcom's driver says that CIOBE multisplit has a bug */
10867#if 0
10868 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 &&
10869 grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5704CIOBE) {
10870 tp->tg3_flags |= TG3_FLAG_SPLIT_MODE;
10871 tp->split_mode_max_reqs = SPLIT_MODE_5704_MAX_REQ;
10872 }
10873#endif
10874 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 && 10880 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
10875 (grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5788 || 10881 (grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5788 ||
10876 grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5788M)) 10882 grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5788M))
@@ -11968,14 +11974,12 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
11968 i == 5 ? '\n' : ':'); 11974 i == 5 ? '\n' : ':');
11969 11975
11970 printk(KERN_INFO "%s: RXcsums[%d] LinkChgREG[%d] " 11976 printk(KERN_INFO "%s: RXcsums[%d] LinkChgREG[%d] "
11971 "MIirq[%d] ASF[%d] Split[%d] WireSpeed[%d] " 11977 "MIirq[%d] ASF[%d] WireSpeed[%d] TSOcap[%d]\n",
11972 "TSOcap[%d] \n",
11973 dev->name, 11978 dev->name,
11974 (tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) != 0, 11979 (tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) != 0,
11975 (tp->tg3_flags & TG3_FLAG_USE_LINKCHG_REG) != 0, 11980 (tp->tg3_flags & TG3_FLAG_USE_LINKCHG_REG) != 0,
11976 (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) != 0, 11981 (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) != 0,
11977 (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0, 11982 (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0,
11978 (tp->tg3_flags & TG3_FLAG_SPLIT_MODE) != 0,
11979 (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED) == 0, 11983 (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED) == 0,
11980 (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) != 0); 11984 (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) != 0);
11981 printk(KERN_INFO "%s: dma_rwctrl[%08x] dma_mask[%d-bit]\n", 11985 printk(KERN_INFO "%s: dma_rwctrl[%08x] dma_mask[%d-bit]\n",
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 086892d8c1f1..d515ed23841b 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2223,7 +2223,7 @@ struct tg3 {
2223#define TG3_FLAG_40BIT_DMA_BUG 0x08000000 2223#define TG3_FLAG_40BIT_DMA_BUG 0x08000000
2224#define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000 2224#define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000
2225#define TG3_FLAG_GOT_SERDES_FLOWCTL 0x20000000 2225#define TG3_FLAG_GOT_SERDES_FLOWCTL 0x20000000
2226#define TG3_FLAG_SPLIT_MODE 0x40000000 2226#define TG3_FLAG_CHIP_RESETTING 0x40000000
2227#define TG3_FLAG_INIT_COMPLETE 0x80000000 2227#define TG3_FLAG_INIT_COMPLETE 0x80000000
2228 u32 tg3_flags2; 2228 u32 tg3_flags2;
2229#define TG3_FLG2_RESTART_TIMER 0x00000001 2229#define TG3_FLG2_RESTART_TIMER 0x00000001
@@ -2262,9 +2262,6 @@ struct tg3 {
2262#define TG3_FLG2_NO_FWARE_REPORTED 0x40000000 2262#define TG3_FLG2_NO_FWARE_REPORTED 0x40000000
2263#define TG3_FLG2_PHY_ADJUST_TRIM 0x80000000 2263#define TG3_FLG2_PHY_ADJUST_TRIM 0x80000000
2264 2264
2265 u32 split_mode_max_reqs;
2266#define SPLIT_MODE_5704_MAX_REQ 3
2267
2268 struct timer_list timer; 2265 struct timer_list timer;
2269 u16 timer_counter; 2266 u16 timer_counter;
2270 u16 timer_multiplier; 2267 u16 timer_multiplier;
diff --git a/drivers/net/wan/lmc/lmc_media.h b/drivers/net/wan/lmc/lmc_media.h
deleted file mode 100644
index ddcc00403563..000000000000
--- a/drivers/net/wan/lmc/lmc_media.h
+++ /dev/null
@@ -1,65 +0,0 @@
1#ifndef _LMC_MEDIA_H_
2#define _LMC_MEDIA_H_
3
4lmc_media_t lmc_ds3_media = {
5 lmc_ds3_init, /* special media init stuff */
6 lmc_ds3_default, /* reset to default state */
7 lmc_ds3_set_status, /* reset status to state provided */
8 lmc_dummy_set_1, /* set clock source */
9 lmc_dummy_set2_1, /* set line speed */
10 lmc_ds3_set_100ft, /* set cable length */
11 lmc_ds3_set_scram, /* set scrambler */
12 lmc_ds3_get_link_status, /* get link status */
13 lmc_dummy_set_1, /* set link status */
14 lmc_ds3_set_crc_length, /* set CRC length */
15 lmc_dummy_set_1, /* set T1 or E1 circuit type */
16 lmc_ds3_watchdog
17};
18
19lmc_media_t lmc_hssi_media = {
20 lmc_hssi_init, /* special media init stuff */
21 lmc_hssi_default, /* reset to default state */
22 lmc_hssi_set_status, /* reset status to state provided */
23 lmc_hssi_set_clock, /* set clock source */
24 lmc_dummy_set2_1, /* set line speed */
25 lmc_dummy_set_1, /* set cable length */
26 lmc_dummy_set_1, /* set scrambler */
27 lmc_hssi_get_link_status, /* get link status */
28 lmc_hssi_set_link_status, /* set link status */
29 lmc_hssi_set_crc_length, /* set CRC length */
30 lmc_dummy_set_1, /* set T1 or E1 circuit type */
31 lmc_hssi_watchdog
32};
33
34lmc_media_t lmc_ssi_media = { lmc_ssi_init, /* special media init stuff */
35 lmc_ssi_default, /* reset to default state */
36 lmc_ssi_set_status, /* reset status to state provided */
37 lmc_ssi_set_clock, /* set clock source */
38 lmc_ssi_set_speed, /* set line speed */
39 lmc_dummy_set_1, /* set cable length */
40 lmc_dummy_set_1, /* set scrambler */
41 lmc_ssi_get_link_status, /* get link status */
42 lmc_ssi_set_link_status, /* set link status */
43 lmc_ssi_set_crc_length, /* set CRC length */
44 lmc_dummy_set_1, /* set T1 or E1 circuit type */
45 lmc_ssi_watchdog
46};
47
48lmc_media_t lmc_t1_media = {
49 lmc_t1_init, /* special media init stuff */
50 lmc_t1_default, /* reset to default state */
51 lmc_t1_set_status, /* reset status to state provided */
52 lmc_t1_set_clock, /* set clock source */
53 lmc_dummy_set2_1, /* set line speed */
54 lmc_dummy_set_1, /* set cable length */
55 lmc_dummy_set_1, /* set scrambler */
56 lmc_t1_get_link_status, /* get link status */
57 lmc_dummy_set_1, /* set link status */
58 lmc_t1_set_crc_length, /* set CRC length */
59 lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
60 lmc_t1_watchdog
61};
62
63
64#endif
65
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index bc3c26494c3d..d585ea9fa97d 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -34,6 +34,7 @@ struct fib_rules_ops
34 int family; 34 int family;
35 struct list_head list; 35 struct list_head list;
36 int rule_size; 36 int rule_size;
37 int addr_size;
37 38
38 int (*action)(struct fib_rule *, 39 int (*action)(struct fib_rule *,
39 struct flowi *, int, 40 struct flowi *, int,
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 9eda572a2a65..cf355a3c2ad5 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -58,6 +58,7 @@ struct fib6_node
58 __u16 fn_bit; /* bit key */ 58 __u16 fn_bit; /* bit key */
59 __u16 fn_flags; 59 __u16 fn_flags;
60 __u32 fn_sernum; 60 __u32 fn_sernum;
61 struct rt6_info *rr_ptr;
61}; 62};
62 63
63#ifndef CONFIG_IPV6_SUBTREES 64#ifndef CONFIG_IPV6_SUBTREES
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 3725b93c52f3..ad7fe1121412 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -36,7 +36,7 @@ struct neigh_parms
36 struct net_device *dev; 36 struct net_device *dev;
37 struct neigh_parms *next; 37 struct neigh_parms *next;
38 int (*neigh_setup)(struct neighbour *); 38 int (*neigh_setup)(struct neighbour *);
39 void (*neigh_destructor)(struct neighbour *); 39 void (*neigh_cleanup)(struct neighbour *);
40 struct neigh_table *tbl; 40 struct neigh_table *tbl;
41 41
42 void *sysctl_table; 42 void *sysctl_table;
diff --git a/net/atm/clip.c b/net/atm/clip.c
index ebb5d0ce8b6f..8c3825816085 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -261,14 +261,6 @@ static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb)
261 spin_unlock_irqrestore(&PRIV(dev)->xoff_lock, flags); 261 spin_unlock_irqrestore(&PRIV(dev)->xoff_lock, flags);
262} 262}
263 263
264static void clip_neigh_destroy(struct neighbour *neigh)
265{
266 DPRINTK("clip_neigh_destroy (neigh %p)\n", neigh);
267 if (NEIGH2ENTRY(neigh)->vccs)
268 printk(KERN_CRIT "clip_neigh_destroy: vccs != NULL !!!\n");
269 NEIGH2ENTRY(neigh)->vccs = (void *) NEIGHBOR_DEAD;
270}
271
272static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb) 264static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb)
273{ 265{
274 DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb); 266 DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb);
@@ -342,7 +334,6 @@ static struct neigh_table clip_tbl = {
342 /* parameters are copied from ARP ... */ 334 /* parameters are copied from ARP ... */
343 .parms = { 335 .parms = {
344 .tbl = &clip_tbl, 336 .tbl = &clip_tbl,
345 .neigh_destructor = clip_neigh_destroy,
346 .base_reachable_time = 30 * HZ, 337 .base_reachable_time = 30 * HZ,
347 .retrans_time = 1 * HZ, 338 .retrans_time = 1 * HZ,
348 .gc_staletime = 60 * HZ, 339 .gc_staletime = 60 * HZ,
diff --git a/net/ax25/Kconfig b/net/ax25/Kconfig
index a8993a041724..43dd86fca4d3 100644
--- a/net/ax25/Kconfig
+++ b/net/ax25/Kconfig
@@ -1,30 +1,27 @@
1# 1#
2# Amateur Radio protocols and AX.25 device configuration 2# Amateur Radio protocols and AX.25 device configuration
3# 3#
4# 19971130 Now in an own category to make correct compilation of the
5# AX.25 stuff easier...
6# Joerg Reuter DL1BKE <jreuter@yaina.de>
7# 19980129 Moved to net/ax25/Config.in, sourcing device drivers.
8 4
9menuconfig HAMRADIO 5menuconfig HAMRADIO
10 depends on NET 6 depends on NET
11 bool "Amateur Radio support" 7 bool "Amateur Radio support"
12 help 8 help
13 If you want to connect your Linux box to an amateur radio, answer Y 9 If you want to connect your Linux box to an amateur radio, answer Y
14 here. You want to read <http://www.tapr.org/tapr/html/pkthome.html> and 10 here. You want to read <http://www.tapr.org/tapr/html/pkthome.html>
15 the AX25-HOWTO, available from <http://www.tldp.org/docs.html#howto>. 11 and more specifically about AX.25 on Linux
12 <http://www.linux-ax25.org/>.
16 13
17 Note that the answer to this question won't directly affect the 14 Note that the answer to this question won't directly affect the
18 kernel: saying N will just cause the configurator to skip all 15 kernel: saying N will just cause the configurator to skip all
19 the questions about amateur radio. 16 the questions about amateur radio.
20 17
21comment "Packet Radio protocols" 18comment "Packet Radio protocols"
22 depends on HAMRADIO && NET 19 depends on HAMRADIO
23 20
24config AX25 21config AX25
25 tristate "Amateur Radio AX.25 Level 2 protocol" 22 tristate "Amateur Radio AX.25 Level 2 protocol"
26 depends on HAMRADIO && NET 23 depends on HAMRADIO
27 ---help--- 24 help
28 This is the protocol used for computer communication over amateur 25 This is the protocol used for computer communication over amateur
29 radio. It is either used by itself for point-to-point links, or to 26 radio. It is either used by itself for point-to-point links, or to
30 carry other protocols such as tcp/ip. To use it, you need a device 27 carry other protocols such as tcp/ip. To use it, you need a device
@@ -52,6 +49,7 @@ config AX25
52 49
53config AX25_DAMA_SLAVE 50config AX25_DAMA_SLAVE
54 bool "AX.25 DAMA Slave support" 51 bool "AX.25 DAMA Slave support"
52 default y
55 depends on AX25 53 depends on AX25
56 help 54 help
57 DAMA is a mechanism to prevent collisions when doing AX.25 55 DAMA is a mechanism to prevent collisions when doing AX.25
@@ -59,23 +57,38 @@ config AX25_DAMA_SLAVE
59 from clients (called "slaves") and redistributes it to other slaves. 57 from clients (called "slaves") and redistributes it to other slaves.
60 If you say Y here, your Linux box will act as a DAMA slave; this is 58 If you say Y here, your Linux box will act as a DAMA slave; this is
61 transparent in that you don't have to do any special DAMA 59 transparent in that you don't have to do any special DAMA
62 configuration. (Linux cannot yet act as a DAMA server.) If unsure, 60 configuration. Linux cannot yet act as a DAMA server. This option
63 say N. 61 only compiles DAMA slave support into the kernel. It still needs to
62 be enabled at runtime. For more about DAMA see
63 <http://www.linux-ax25.org>. If unsure, say Y.
64
65# placeholder until implemented
66config AX25_DAMA_MASTER
67 bool 'AX.25 DAMA Master support'
68 depends on AX25_DAMA_SLAVE && BROKEN
69 help
70 DAMA is a mechanism to prevent collisions when doing AX.25
71 networking. A DAMA server (called "master") accepts incoming traffic
72 from clients (called "slaves") and redistributes it to other slaves.
73 If you say Y here, your Linux box will act as a DAMA master; this is
74 transparent in that you don't have to do any special DAMA
75 configuration. Linux cannot yet act as a DAMA server. This option
76 only compiles DAMA slave support into the kernel. It still needs to
77 be explicitly enabled, so if unsure, say Y.
64 78
65# bool ' AX.25 DAMA Master support' CONFIG_AX25_DAMA_MASTER
66config NETROM 79config NETROM
67 tristate "Amateur Radio NET/ROM protocol" 80 tristate "Amateur Radio NET/ROM protocol"
68 depends on AX25 81 depends on AX25
69 ---help--- 82 help
70 NET/ROM is a network layer protocol on top of AX.25 useful for 83 NET/ROM is a network layer protocol on top of AX.25 useful for
71 routing. 84 routing.
72 85
73 A comprehensive listing of all the software for Linux amateur radio 86 A comprehensive listing of all the software for Linux amateur radio
74 users as well as information about how to configure an AX.25 port is 87 users as well as information about how to configure an AX.25 port is
75 contained in the AX25-HOWTO, available from 88 contained in the Linux Ham Wiki, available from
76 <http://www.tldp.org/docs.html#howto>. You also might want to 89 <http://www.linux-ax25.org>. You also might want to check out the
77 check out the file <file:Documentation/networking/ax25.txt>. More 90 file <file:Documentation/networking/ax25.txt>. More information about
78 information about digital amateur radio in general is on the WWW at 91 digital amateur radio in general is on the WWW at
79 <http://www.tapr.org/tapr/html/pkthome.html>. 92 <http://www.tapr.org/tapr/html/pkthome.html>.
80 93
81 To compile this driver as a module, choose M here: the 94 To compile this driver as a module, choose M here: the
@@ -84,27 +97,25 @@ config NETROM
84config ROSE 97config ROSE
85 tristate "Amateur Radio X.25 PLP (Rose)" 98 tristate "Amateur Radio X.25 PLP (Rose)"
86 depends on AX25 99 depends on AX25
87 ---help--- 100 help
88 The Packet Layer Protocol (PLP) is a way to route packets over X.25 101 The Packet Layer Protocol (PLP) is a way to route packets over X.25
89 connections in general and amateur radio AX.25 connections in 102 connections in general and amateur radio AX.25 connections in
90 particular, essentially an alternative to NET/ROM. 103 particular, essentially an alternative to NET/ROM.
91 104
92 A comprehensive listing of all the software for Linux amateur radio 105 A comprehensive listing of all the software for Linux amateur radio
93 users as well as information about how to configure an AX.25 port is 106 users as well as information about how to configure an AX.25 port is
94 contained in the AX25-HOWTO, available from 107 contained in the Linux Ham Wiki, available from
95 <http://www.tldp.org/docs.html#howto>. You also might want to 108 <http://www.linux-ax25.org>. You also might want to check out the
96 check out the file <file:Documentation/networking/ax25.txt>. More 109 file <file:Documentation/networking/ax25.txt>. More information about
97 information about digital amateur radio in general is on the WWW at 110 digital amateur radio in general is on the WWW at
98 <http://www.tapr.org/tapr/html/pkthome.html>. 111 <http://www.tapr.org/tapr/html/pkthome.html>.
99 112
100 To compile this driver as a module, choose M here: the 113 To compile this driver as a module, choose M here: the
101 module will be called rose. 114 module will be called rose.
102 115
103
104menu "AX.25 network device drivers" 116menu "AX.25 network device drivers"
105 depends on HAMRADIO && NET && AX25!=n 117 depends on HAMRADIO && AX25
106 118
107source "drivers/net/hamradio/Kconfig" 119source "drivers/net/hamradio/Kconfig"
108 120
109endmenu 121endmenu
110
diff --git a/net/core/dev.c b/net/core/dev.c
index cf71614dae93..5984b55311a1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1750,10 +1750,10 @@ static int ing_filter(struct sk_buff *skb)
1750 1750
1751 skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_INGRESS); 1751 skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_INGRESS);
1752 1752
1753 spin_lock(&dev->ingress_lock); 1753 spin_lock(&dev->queue_lock);
1754 if ((q = dev->qdisc_ingress) != NULL) 1754 if ((q = dev->qdisc_ingress) != NULL)
1755 result = q->enqueue(skb, q); 1755 result = q->enqueue(skb, q);
1756 spin_unlock(&dev->ingress_lock); 1756 spin_unlock(&dev->queue_lock);
1757 1757
1758 } 1758 }
1759 1759
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 3aea4e87d3d7..d011819a8058 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -152,6 +152,28 @@ out:
152 152
153EXPORT_SYMBOL_GPL(fib_rules_lookup); 153EXPORT_SYMBOL_GPL(fib_rules_lookup);
154 154
155static int validate_rulemsg(struct fib_rule_hdr *frh, struct nlattr **tb,
156 struct fib_rules_ops *ops)
157{
158 int err = -EINVAL;
159
160 if (frh->src_len)
161 if (tb[FRA_SRC] == NULL ||
162 frh->src_len > (ops->addr_size * 8) ||
163 nla_len(tb[FRA_SRC]) != ops->addr_size)
164 goto errout;
165
166 if (frh->dst_len)
167 if (tb[FRA_DST] == NULL ||
168 frh->dst_len > (ops->addr_size * 8) ||
169 nla_len(tb[FRA_DST]) != ops->addr_size)
170 goto errout;
171
172 err = 0;
173errout:
174 return err;
175}
176
155int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) 177int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
156{ 178{
157 struct fib_rule_hdr *frh = nlmsg_data(nlh); 179 struct fib_rule_hdr *frh = nlmsg_data(nlh);
@@ -173,6 +195,10 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
173 if (err < 0) 195 if (err < 0)
174 goto errout; 196 goto errout;
175 197
198 err = validate_rulemsg(frh, tb, ops);
199 if (err < 0)
200 goto errout;
201
176 rule = kzalloc(ops->rule_size, GFP_KERNEL); 202 rule = kzalloc(ops->rule_size, GFP_KERNEL);
177 if (rule == NULL) { 203 if (rule == NULL) {
178 err = -ENOMEM; 204 err = -ENOMEM;
@@ -260,6 +286,10 @@ int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
260 if (err < 0) 286 if (err < 0)
261 goto errout; 287 goto errout;
262 288
289 err = validate_rulemsg(frh, tb, ops);
290 if (err < 0)
291 goto errout;
292
263 list_for_each_entry(rule, ops->rules_list, list) { 293 list_for_each_entry(rule, ops->rules_list, list) {
264 if (frh->action && (frh->action != rule->action)) 294 if (frh->action && (frh->action != rule->action))
265 continue; 295 continue;
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 3183142c6044..cfc60019cf92 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -140,6 +140,8 @@ static int neigh_forced_gc(struct neigh_table *tbl)
140 n->dead = 1; 140 n->dead = 1;
141 shrunk = 1; 141 shrunk = 1;
142 write_unlock(&n->lock); 142 write_unlock(&n->lock);
143 if (n->parms->neigh_cleanup)
144 n->parms->neigh_cleanup(n);
143 neigh_release(n); 145 neigh_release(n);
144 continue; 146 continue;
145 } 147 }
@@ -211,6 +213,8 @@ static void neigh_flush_dev(struct neigh_table *tbl, struct net_device *dev)
211 NEIGH_PRINTK2("neigh %p is stray.\n", n); 213 NEIGH_PRINTK2("neigh %p is stray.\n", n);
212 } 214 }
213 write_unlock(&n->lock); 215 write_unlock(&n->lock);
216 if (n->parms->neigh_cleanup)
217 n->parms->neigh_cleanup(n);
214 neigh_release(n); 218 neigh_release(n);
215 } 219 }
216 } 220 }
@@ -582,9 +586,6 @@ void neigh_destroy(struct neighbour *neigh)
582 kfree(hh); 586 kfree(hh);
583 } 587 }
584 588
585 if (neigh->parms->neigh_destructor)
586 (neigh->parms->neigh_destructor)(neigh);
587
588 skb_queue_purge(&neigh->arp_queue); 589 skb_queue_purge(&neigh->arp_queue);
589 590
590 dev_put(neigh->dev); 591 dev_put(neigh->dev);
@@ -675,6 +676,8 @@ static void neigh_periodic_timer(unsigned long arg)
675 *np = n->next; 676 *np = n->next;
676 n->dead = 1; 677 n->dead = 1;
677 write_unlock(&n->lock); 678 write_unlock(&n->lock);
679 if (n->parms->neigh_cleanup)
680 n->parms->neigh_cleanup(n);
678 neigh_release(n); 681 neigh_release(n);
679 continue; 682 continue;
680 } 683 }
@@ -2088,8 +2091,11 @@ void __neigh_for_each_release(struct neigh_table *tbl,
2088 } else 2091 } else
2089 np = &n->next; 2092 np = &n->next;
2090 write_unlock(&n->lock); 2093 write_unlock(&n->lock);
2091 if (release) 2094 if (release) {
2095 if (n->parms->neigh_cleanup)
2096 n->parms->neigh_cleanup(n);
2092 neigh_release(n); 2097 neigh_release(n);
2098 }
2093 } 2099 }
2094 } 2100 }
2095} 2101}
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index a0e7cd183a5d..e33a9edb4036 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -191,7 +191,6 @@ extern void dccp_send_sync(struct sock *sk, const u64 seq,
191 const enum dccp_pkt_type pkt_type); 191 const enum dccp_pkt_type pkt_type);
192 192
193extern void dccp_write_xmit(struct sock *sk, int block); 193extern void dccp_write_xmit(struct sock *sk, int block);
194extern void dccp_write_xmit_timer(unsigned long data);
195extern void dccp_write_space(struct sock *sk); 194extern void dccp_write_space(struct sock *sk);
196 195
197extern void dccp_init_xmit_timers(struct sock *sk); 196extern void dccp_init_xmit_timers(struct sock *sk);
diff --git a/net/dccp/timer.c b/net/dccp/timer.c
index b038a0a3ad40..0197a41c256a 100644
--- a/net/dccp/timer.c
+++ b/net/dccp/timer.c
@@ -262,7 +262,7 @@ out:
262} 262}
263 263
264/* Transmit-delay timer: used by the CCIDs to delay actual send time */ 264/* Transmit-delay timer: used by the CCIDs to delay actual send time */
265void dccp_write_xmit_timer(unsigned long data) 265static void dccp_write_xmit_timer(unsigned long data)
266{ 266{
267 struct sock *sk = (struct sock *)data; 267 struct sock *sk = (struct sock *)data;
268 struct dccp_sock *dp = dccp_sk(sk); 268 struct dccp_sock *dp = dccp_sk(sk);
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 3cbfddc98430..82d58a977e6f 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -63,7 +63,7 @@ static struct
63{ 63{
64 int error; 64 int error;
65 u8 scope; 65 u8 scope;
66} dn_fib_props[RTA_MAX+1] = { 66} dn_fib_props[RTN_MAX+1] = {
67 [RTN_UNSPEC] = { .error = 0, .scope = RT_SCOPE_NOWHERE }, 67 [RTN_UNSPEC] = { .error = 0, .scope = RT_SCOPE_NOWHERE },
68 [RTN_UNICAST] = { .error = 0, .scope = RT_SCOPE_UNIVERSE }, 68 [RTN_UNICAST] = { .error = 0, .scope = RT_SCOPE_UNIVERSE },
69 [RTN_LOCAL] = { .error = 0, .scope = RT_SCOPE_HOST }, 69 [RTN_LOCAL] = { .error = 0, .scope = RT_SCOPE_HOST },
@@ -276,6 +276,9 @@ struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, struct dn_kern_rta
276 struct dn_fib_info *ofi; 276 struct dn_fib_info *ofi;
277 int nhs = 1; 277 int nhs = 1;
278 278
279 if (r->rtm_type > RTN_MAX)
280 goto err_inval;
281
279 if (dn_fib_props[r->rtm_type].scope > r->rtm_scope) 282 if (dn_fib_props[r->rtm_type].scope > r->rtm_scope)
280 goto err_inval; 283 goto err_inval;
281 284
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index b6c98ac93dc8..5e86dd542302 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -109,8 +109,6 @@ errout:
109 109
110static struct nla_policy dn_fib_rule_policy[FRA_MAX+1] __read_mostly = { 110static struct nla_policy dn_fib_rule_policy[FRA_MAX+1] __read_mostly = {
111 FRA_GENERIC_POLICY, 111 FRA_GENERIC_POLICY,
112 [FRA_SRC] = { .type = NLA_U16 },
113 [FRA_DST] = { .type = NLA_U16 },
114}; 112};
115 113
116static int dn_fib_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) 114static int dn_fib_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
@@ -133,7 +131,7 @@ static int dn_fib_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
133 int err = -EINVAL; 131 int err = -EINVAL;
134 struct dn_fib_rule *r = (struct dn_fib_rule *)rule; 132 struct dn_fib_rule *r = (struct dn_fib_rule *)rule;
135 133
136 if (frh->src_len > 16 || frh->dst_len > 16 || frh->tos) 134 if (frh->tos)
137 goto errout; 135 goto errout;
138 136
139 if (rule->table == RT_TABLE_UNSPEC) { 137 if (rule->table == RT_TABLE_UNSPEC) {
@@ -150,10 +148,10 @@ static int dn_fib_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
150 } 148 }
151 } 149 }
152 150
153 if (tb[FRA_SRC]) 151 if (frh->src_len)
154 r->src = nla_get_le16(tb[FRA_SRC]); 152 r->src = nla_get_le16(tb[FRA_SRC]);
155 153
156 if (tb[FRA_DST]) 154 if (frh->dst_len)
157 r->dst = nla_get_le16(tb[FRA_DST]); 155 r->dst = nla_get_le16(tb[FRA_DST]);
158 156
159 r->src_len = frh->src_len; 157 r->src_len = frh->src_len;
@@ -176,10 +174,10 @@ static int dn_fib_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
176 if (frh->dst_len && (r->dst_len != frh->dst_len)) 174 if (frh->dst_len && (r->dst_len != frh->dst_len))
177 return 0; 175 return 0;
178 176
179 if (tb[FRA_SRC] && (r->src != nla_get_le16(tb[FRA_SRC]))) 177 if (frh->src_len && (r->src != nla_get_le16(tb[FRA_SRC])))
180 return 0; 178 return 0;
181 179
182 if (tb[FRA_DST] && (r->dst != nla_get_le16(tb[FRA_DST]))) 180 if (frh->dst_len && (r->dst != nla_get_le16(tb[FRA_DST])))
183 return 0; 181 return 0;
184 182
185 return 1; 183 return 1;
@@ -249,6 +247,7 @@ int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb)
249static struct fib_rules_ops dn_fib_rules_ops = { 247static struct fib_rules_ops dn_fib_rules_ops = {
250 .family = AF_DECnet, 248 .family = AF_DECnet,
251 .rule_size = sizeof(struct dn_fib_rule), 249 .rule_size = sizeof(struct dn_fib_rule),
250 .addr_size = sizeof(u16),
252 .action = dn_fib_rule_action, 251 .action = dn_fib_rule_action,
253 .match = dn_fib_rule_match, 252 .match = dn_fib_rule_match,
254 .configure = dn_fib_rule_configure, 253 .configure = dn_fib_rule_configure,
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 1fba6439fc57..fc920f63452b 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -493,6 +493,11 @@ static int rtm_to_fib_config(struct sk_buff *skb, struct nlmsghdr *nlh,
493 cfg->fc_nlinfo.pid = NETLINK_CB(skb).pid; 493 cfg->fc_nlinfo.pid = NETLINK_CB(skb).pid;
494 cfg->fc_nlinfo.nlh = nlh; 494 cfg->fc_nlinfo.nlh = nlh;
495 495
496 if (cfg->fc_type > RTN_MAX) {
497 err = -EINVAL;
498 goto errout;
499 }
500
496 nlmsg_for_each_attr(attr, nlh, sizeof(struct rtmsg), remaining) { 501 nlmsg_for_each_attr(attr, nlh, sizeof(struct rtmsg), remaining) {
497 switch (attr->nla_type) { 502 switch (attr->nla_type) {
498 case RTA_DST: 503 case RTA_DST:
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index b837c33e0404..c660c074c76c 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -171,8 +171,6 @@ static struct fib_table *fib_empty_table(void)
171 171
172static struct nla_policy fib4_rule_policy[FRA_MAX+1] __read_mostly = { 172static struct nla_policy fib4_rule_policy[FRA_MAX+1] __read_mostly = {
173 FRA_GENERIC_POLICY, 173 FRA_GENERIC_POLICY,
174 [FRA_SRC] = { .type = NLA_U32 },
175 [FRA_DST] = { .type = NLA_U32 },
176 [FRA_FLOW] = { .type = NLA_U32 }, 174 [FRA_FLOW] = { .type = NLA_U32 },
177}; 175};
178 176
@@ -183,8 +181,7 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
183 int err = -EINVAL; 181 int err = -EINVAL;
184 struct fib4_rule *rule4 = (struct fib4_rule *) rule; 182 struct fib4_rule *rule4 = (struct fib4_rule *) rule;
185 183
186 if (frh->src_len > 32 || frh->dst_len > 32 || 184 if (frh->tos & ~IPTOS_TOS_MASK)
187 (frh->tos & ~IPTOS_TOS_MASK))
188 goto errout; 185 goto errout;
189 186
190 if (rule->table == RT_TABLE_UNSPEC) { 187 if (rule->table == RT_TABLE_UNSPEC) {
@@ -201,10 +198,10 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
201 } 198 }
202 } 199 }
203 200
204 if (tb[FRA_SRC]) 201 if (frh->src_len)
205 rule4->src = nla_get_be32(tb[FRA_SRC]); 202 rule4->src = nla_get_be32(tb[FRA_SRC]);
206 203
207 if (tb[FRA_DST]) 204 if (frh->dst_len)
208 rule4->dst = nla_get_be32(tb[FRA_DST]); 205 rule4->dst = nla_get_be32(tb[FRA_DST]);
209 206
210#ifdef CONFIG_NET_CLS_ROUTE 207#ifdef CONFIG_NET_CLS_ROUTE
@@ -242,10 +239,10 @@ static int fib4_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
242 return 0; 239 return 0;
243#endif 240#endif
244 241
245 if (tb[FRA_SRC] && (rule4->src != nla_get_be32(tb[FRA_SRC]))) 242 if (frh->src_len && (rule4->src != nla_get_be32(tb[FRA_SRC])))
246 return 0; 243 return 0;
247 244
248 if (tb[FRA_DST] && (rule4->dst != nla_get_be32(tb[FRA_DST]))) 245 if (frh->dst_len && (rule4->dst != nla_get_be32(tb[FRA_DST])))
249 return 0; 246 return 0;
250 247
251 return 1; 248 return 1;
@@ -309,6 +306,7 @@ static size_t fib4_rule_nlmsg_payload(struct fib_rule *rule)
309static struct fib_rules_ops fib4_rules_ops = { 306static struct fib_rules_ops fib4_rules_ops = {
310 .family = AF_INET, 307 .family = AF_INET,
311 .rule_size = sizeof(struct fib4_rule), 308 .rule_size = sizeof(struct fib4_rule),
309 .addr_size = sizeof(u32),
312 .action = fib4_rule_action, 310 .action = fib4_rule_action,
313 .match = fib4_rule_match, 311 .match = fib4_rule_match,
314 .configure = fib4_rule_configure, 312 .configure = fib4_rule_configure,
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 2f1fdae6efa6..3dad12ee76c3 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -89,7 +89,7 @@ static const struct
89{ 89{
90 int error; 90 int error;
91 u8 scope; 91 u8 scope;
92} fib_props[RTA_MAX + 1] = { 92} fib_props[RTN_MAX + 1] = {
93 { 93 {
94 .error = 0, 94 .error = 0,
95 .scope = RT_SCOPE_NOWHERE, 95 .scope = RT_SCOPE_NOWHERE,
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index ada9b3db507d..214c34732e84 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1123,6 +1123,9 @@ err:
1123 return fa_head; 1123 return fa_head;
1124} 1124}
1125 1125
1126/*
1127 * Caller must hold RTNL.
1128 */
1126static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg) 1129static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg)
1127{ 1130{
1128 struct trie *t = (struct trie *) tb->tb_data; 1131 struct trie *t = (struct trie *) tb->tb_data;
@@ -1540,6 +1543,9 @@ static int trie_leaf_remove(struct trie *t, t_key key)
1540 return 1; 1543 return 1;
1541} 1544}
1542 1545
1546/*
1547 * Caller must hold RTNL.
1548 */
1543static int fn_trie_delete(struct fib_table *tb, struct fib_config *cfg) 1549static int fn_trie_delete(struct fib_table *tb, struct fib_config *cfg)
1544{ 1550{
1545 struct trie *t = (struct trie *) tb->tb_data; 1551 struct trie *t = (struct trie *) tb->tb_data;
@@ -1718,6 +1724,9 @@ up:
1718 return NULL; /* Ready. Root of trie */ 1724 return NULL; /* Ready. Root of trie */
1719} 1725}
1720 1726
1727/*
1728 * Caller must hold RTNL.
1729 */
1721static int fn_trie_flush(struct fib_table *tb) 1730static int fn_trie_flush(struct fib_table *tb)
1722{ 1731{
1723 struct trie *t = (struct trie *) tb->tb_data; 1732 struct trie *t = (struct trie *) tb->tb_data;
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 0862809ffcf7..ea3035b4e3e8 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -131,8 +131,6 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
131 131
132static struct nla_policy fib6_rule_policy[FRA_MAX+1] __read_mostly = { 132static struct nla_policy fib6_rule_policy[FRA_MAX+1] __read_mostly = {
133 FRA_GENERIC_POLICY, 133 FRA_GENERIC_POLICY,
134 [FRA_SRC] = { .len = sizeof(struct in6_addr) },
135 [FRA_DST] = { .len = sizeof(struct in6_addr) },
136}; 134};
137 135
138static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb, 136static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
@@ -142,9 +140,6 @@ static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
142 int err = -EINVAL; 140 int err = -EINVAL;
143 struct fib6_rule *rule6 = (struct fib6_rule *) rule; 141 struct fib6_rule *rule6 = (struct fib6_rule *) rule;
144 142
145 if (frh->src_len > 128 || frh->dst_len > 128)
146 goto errout;
147
148 if (rule->action == FR_ACT_TO_TBL) { 143 if (rule->action == FR_ACT_TO_TBL) {
149 if (rule->table == RT6_TABLE_UNSPEC) 144 if (rule->table == RT6_TABLE_UNSPEC)
150 goto errout; 145 goto errout;
@@ -155,11 +150,11 @@ static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
155 } 150 }
156 } 151 }
157 152
158 if (tb[FRA_SRC]) 153 if (frh->src_len)
159 nla_memcpy(&rule6->src.addr, tb[FRA_SRC], 154 nla_memcpy(&rule6->src.addr, tb[FRA_SRC],
160 sizeof(struct in6_addr)); 155 sizeof(struct in6_addr));
161 156
162 if (tb[FRA_DST]) 157 if (frh->dst_len)
163 nla_memcpy(&rule6->dst.addr, tb[FRA_DST], 158 nla_memcpy(&rule6->dst.addr, tb[FRA_DST],
164 sizeof(struct in6_addr)); 159 sizeof(struct in6_addr));
165 160
@@ -186,11 +181,11 @@ static int fib6_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
186 if (frh->tos && (rule6->tclass != frh->tos)) 181 if (frh->tos && (rule6->tclass != frh->tos))
187 return 0; 182 return 0;
188 183
189 if (tb[FRA_SRC] && 184 if (frh->src_len &&
190 nla_memcmp(tb[FRA_SRC], &rule6->src.addr, sizeof(struct in6_addr))) 185 nla_memcmp(tb[FRA_SRC], &rule6->src.addr, sizeof(struct in6_addr)))
191 return 0; 186 return 0;
192 187
193 if (tb[FRA_DST] && 188 if (frh->dst_len &&
194 nla_memcmp(tb[FRA_DST], &rule6->dst.addr, sizeof(struct in6_addr))) 189 nla_memcmp(tb[FRA_DST], &rule6->dst.addr, sizeof(struct in6_addr)))
195 return 0; 190 return 0;
196 191
@@ -240,6 +235,7 @@ static size_t fib6_rule_nlmsg_payload(struct fib_rule *rule)
240static struct fib_rules_ops fib6_rules_ops = { 235static struct fib_rules_ops fib6_rules_ops = {
241 .family = AF_INET6, 236 .family = AF_INET6,
242 .rule_size = sizeof(struct fib6_rule), 237 .rule_size = sizeof(struct fib6_rule),
238 .addr_size = sizeof(struct in6_addr),
243 .action = fib6_rule_action, 239 .action = fib6_rule_action,
244 .match = fib6_rule_match, 240 .match = fib6_rule_match,
245 .configure = fib6_rule_configure, 241 .configure = fib6_rule_configure,
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index f4d7be77eb0f..268f476ef3db 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -658,6 +658,10 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
658 ins = &iter->u.dst.rt6_next; 658 ins = &iter->u.dst.rt6_next;
659 } 659 }
660 660
661 /* Reset round-robin state, if necessary */
662 if (ins == &fn->leaf)
663 fn->rr_ptr = NULL;
664
661 /* 665 /*
662 * insert node 666 * insert node
663 */ 667 */
@@ -1109,6 +1113,10 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp,
1109 rt6_stats.fib_rt_entries--; 1113 rt6_stats.fib_rt_entries--;
1110 rt6_stats.fib_discarded_routes++; 1114 rt6_stats.fib_discarded_routes++;
1111 1115
1116 /* Reset round-robin state, if necessary */
1117 if (fn->rr_ptr == rt)
1118 fn->rr_ptr = NULL;
1119
1112 /* Adjust walkers */ 1120 /* Adjust walkers */
1113 read_lock(&fib6_walker_lock); 1121 read_lock(&fib6_walker_lock);
1114 FOR_WALKERS(w) { 1122 FOR_WALKERS(w) {
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index a6b3117df546..3931b33b25e8 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -363,55 +363,76 @@ static int rt6_score_route(struct rt6_info *rt, int oif,
363 return m; 363 return m;
364} 364}
365 365
366static struct rt6_info *rt6_select(struct rt6_info **head, int oif, 366static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict,
367 int strict) 367 int *mpri, struct rt6_info *match)
368{ 368{
369 struct rt6_info *match = NULL, *last = NULL; 369 int m;
370 struct rt6_info *rt, *rt0 = *head; 370
371 u32 metric; 371 if (rt6_check_expired(rt))
372 goto out;
373
374 m = rt6_score_route(rt, oif, strict);
375 if (m < 0)
376 goto out;
377
378 if (m > *mpri) {
379 if (strict & RT6_LOOKUP_F_REACHABLE)
380 rt6_probe(match);
381 *mpri = m;
382 match = rt;
383 } else if (strict & RT6_LOOKUP_F_REACHABLE) {
384 rt6_probe(rt);
385 }
386
387out:
388 return match;
389}
390
391static struct rt6_info *find_rr_leaf(struct fib6_node *fn,
392 struct rt6_info *rr_head,
393 u32 metric, int oif, int strict)
394{
395 struct rt6_info *rt, *match;
372 int mpri = -1; 396 int mpri = -1;
373 397
374 RT6_TRACE("%s(head=%p(*head=%p), oif=%d)\n", 398 match = NULL;
375 __FUNCTION__, head, head ? *head : NULL, oif); 399 for (rt = rr_head; rt && rt->rt6i_metric == metric;
400 rt = rt->u.dst.rt6_next)
401 match = find_match(rt, oif, strict, &mpri, match);
402 for (rt = fn->leaf; rt && rt != rr_head && rt->rt6i_metric == metric;
403 rt = rt->u.dst.rt6_next)
404 match = find_match(rt, oif, strict, &mpri, match);
376 405
377 for (rt = rt0, metric = rt0->rt6i_metric; 406 return match;
378 rt && rt->rt6i_metric == metric && (!last || rt != rt0); 407}
379 rt = rt->u.dst.rt6_next) {
380 int m;
381 408
382 if (rt6_check_expired(rt)) 409static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict)
383 continue; 410{
411 struct rt6_info *match, *rt0;
384 412
385 last = rt; 413 RT6_TRACE("%s(fn->leaf=%p, oif=%d)\n",
414 __FUNCTION__, fn->leaf, oif);
386 415
387 m = rt6_score_route(rt, oif, strict); 416 rt0 = fn->rr_ptr;
388 if (m < 0) 417 if (!rt0)
389 continue; 418 fn->rr_ptr = rt0 = fn->leaf;
390 419
391 if (m > mpri) { 420 match = find_rr_leaf(fn, rt0, rt0->rt6i_metric, oif, strict);
392 if (strict & RT6_LOOKUP_F_REACHABLE)
393 rt6_probe(match);
394 match = rt;
395 mpri = m;
396 } else if (strict & RT6_LOOKUP_F_REACHABLE) {
397 rt6_probe(rt);
398 }
399 }
400 421
401 if (!match && 422 if (!match &&
402 (strict & RT6_LOOKUP_F_REACHABLE) && 423 (strict & RT6_LOOKUP_F_REACHABLE)) {
403 last && last != rt0) { 424 struct rt6_info *next = rt0->u.dst.rt6_next;
425
404 /* no entries matched; do round-robin */ 426 /* no entries matched; do round-robin */
405 static DEFINE_SPINLOCK(lock); 427 if (!next || next->rt6i_metric != rt0->rt6i_metric)
406 spin_lock(&lock); 428 next = fn->leaf;
407 *head = rt0->u.dst.rt6_next; 429
408 rt0->u.dst.rt6_next = last->u.dst.rt6_next; 430 if (next != rt0)
409 last->u.dst.rt6_next = rt0; 431 fn->rr_ptr = next;
410 spin_unlock(&lock);
411 } 432 }
412 433
413 RT6_TRACE("%s() => %p, score=%d\n", 434 RT6_TRACE("%s() => %p\n",
414 __FUNCTION__, match, mpri); 435 __FUNCTION__, match);
415 436
416 return (match ? match : &ip6_null_entry); 437 return (match ? match : &ip6_null_entry);
417} 438}
@@ -657,7 +678,7 @@ restart_2:
657 fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src); 678 fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
658 679
659restart: 680restart:
660 rt = rt6_select(&fn->leaf, fl->iif, strict | reachable); 681 rt = rt6_select(fn, fl->iif, strict | reachable);
661 BACKTRACK(&fl->fl6_src); 682 BACKTRACK(&fl->fl6_src);
662 if (rt == &ip6_null_entry || 683 if (rt == &ip6_null_entry ||
663 rt->rt6i_flags & RTF_CACHE) 684 rt->rt6i_flags & RTF_CACHE)
@@ -752,7 +773,7 @@ restart_2:
752 fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src); 773 fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
753 774
754restart: 775restart:
755 rt = rt6_select(&fn->leaf, fl->oif, strict | reachable); 776 rt = rt6_select(fn, fl->oif, strict | reachable);
756 BACKTRACK(&fl->fl6_src); 777 BACKTRACK(&fl->fl6_src);
757 if (rt == &ip6_null_entry || 778 if (rt == &ip6_null_entry ||
758 rt->rt6i_flags & RTF_CACHE) 779 rt->rt6i_flags & RTF_CACHE)
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index fad08e521c24..70fe36eb66a2 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -81,6 +81,13 @@ static void basic_put(struct tcf_proto *tp, unsigned long f)
81 81
82static int basic_init(struct tcf_proto *tp) 82static int basic_init(struct tcf_proto *tp)
83{ 83{
84 struct basic_head *head;
85
86 head = kzalloc(sizeof(*head), GFP_KERNEL);
87 if (head == NULL)
88 return -ENOBUFS;
89 INIT_LIST_HEAD(&head->flist);
90 tp->root = head;
84 return 0; 91 return 0;
85} 92}
86 93
@@ -176,15 +183,6 @@ static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle,
176 } 183 }
177 184
178 err = -ENOBUFS; 185 err = -ENOBUFS;
179 if (head == NULL) {
180 head = kzalloc(sizeof(*head), GFP_KERNEL);
181 if (head == NULL)
182 goto errout;
183
184 INIT_LIST_HEAD(&head->flist);
185 tp->root = head;
186 }
187
188 f = kzalloc(sizeof(*f), GFP_KERNEL); 186 f = kzalloc(sizeof(*f), GFP_KERNEL);
189 if (f == NULL) 187 if (f == NULL)
190 goto errout; 188 goto errout;
diff --git a/net/socket.c b/net/socket.c
index 9566e57ac7f5..ea8f81abc45c 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1381,7 +1381,7 @@ asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr,
1381 1381
1382 err = sock_attach_fd(newsock, newfile); 1382 err = sock_attach_fd(newsock, newfile);
1383 if (err < 0) 1383 if (err < 0)
1384 goto out_fd; 1384 goto out_fd_simple;
1385 1385
1386 err = security_socket_accept(sock, newsock); 1386 err = security_socket_accept(sock, newsock);
1387 if (err) 1387 if (err)
@@ -1414,6 +1414,11 @@ out_put:
1414 fput_light(sock->file, fput_needed); 1414 fput_light(sock->file, fput_needed);
1415out: 1415out:
1416 return err; 1416 return err;
1417out_fd_simple:
1418 sock_release(newsock);
1419 put_filp(newfile);
1420 put_unused_fd(newfd);
1421 goto out_put;
1417out_fd: 1422out_fd:
1418 fput(newfile); 1423 fput(newfile);
1419 put_unused_fd(newfd); 1424 put_unused_fd(newfd);