From 986599973e1f98bb4d92e2f5526af4ac94d16366 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Thu, 22 May 2008 17:06:36 +0200 Subject: [PATCH] --- yaml --- r: 97677 b: refs/heads/master c: 48e6c51bd326ce9faf07fbdf84d361c9755b7035 h: refs/heads/master i: 97675: f121d39ef764282dbe1d16e832f8c3bc4546f089 v: v3 --- [refs] | 2 +- trunk/Documentation/networking/bridge.txt | 2 +- trunk/MAINTAINERS | 2 +- trunk/drivers/net/atlx/atl1.c | 1 - trunk/drivers/net/cs89x0.c | 10 +- trunk/drivers/net/myri10ge/myri10ge.c | 2 +- trunk/drivers/net/sc92031.c | 2 +- trunk/drivers/net/sfc/falcon_xmac.c | 2 +- trunk/drivers/net/sunhme.c | 4 +- trunk/drivers/net/tulip/tulip_core.c | 10 +- trunk/drivers/net/ucc_geth_ethtool.c | 3 +- trunk/drivers/net/virtio_net.c | 36 +----- trunk/drivers/net/wireless/b43legacy/main.c | 17 +-- trunk/include/linux/in_route.h | 12 +- trunk/include/linux/inetdevice.h | 1 + trunk/include/linux/rtnetlink.h | 4 +- trunk/include/net/addrconf.h | 22 ---- trunk/include/net/genetlink.h | 4 +- trunk/include/net/netlink.h | 20 +-- trunk/include/net/sctp/structs.h | 17 +-- trunk/include/net/transp_v6.h | 3 +- trunk/include/net/udp.h | 1 - trunk/net/core/neighbour.c | 9 +- trunk/net/core/rtnetlink.c | 3 +- trunk/net/core/user_dma.c | 2 +- trunk/net/ipv4/devinet.c | 9 ++ trunk/net/ipv4/fib_frontend.c | 1 + trunk/net/ipv4/route.c | 2 +- trunk/net/ipv4/tcp_input.c | 35 ++--- trunk/net/ipv4/tunnel4.c | 2 +- trunk/net/ipv4/udp.c | 3 +- trunk/net/ipv6/addrconf.c | 107 +++++++--------- trunk/net/ipv6/datagram.c | 45 +++---- trunk/net/ipv6/ip6_flowlabel.c | 2 +- trunk/net/ipv6/ipv6_sockglue.c | 21 +-- trunk/net/ipv6/netfilter/nf_conntrack_reasm.c | 8 +- trunk/net/ipv6/raw.c | 2 +- trunk/net/ipv6/route.c | 12 +- trunk/net/ipv6/tunnel6.c | 2 +- trunk/net/ipv6/udp.c | 8 +- trunk/net/irda/af_irda.c | 12 +- trunk/net/netfilter/xt_connlimit.c | 3 +- trunk/net/netlink/attr.c | 12 +- trunk/net/netlink/genetlink.c | 6 +- trunk/net/sched/sch_dsmark.c | 6 +- trunk/net/sched/sch_gred.c | 3 +- trunk/net/sched/sch_hfsc.c | 2 +- trunk/net/sched/sch_red.c | 3 +- trunk/net/sctp/associola.c | 21 ++- trunk/net/sctp/ipv6.c | 11 +- trunk/net/sctp/output.c | 2 +- trunk/net/sctp/outqueue.c | 120 +++++++----------- trunk/net/sctp/protocol.c | 11 +- trunk/net/sctp/transport.c | 50 +++----- trunk/net/wireless/nl80211.c | 12 +- trunk/net/xfrm/xfrm_algo.c | 4 +- 56 files changed, 275 insertions(+), 453 deletions(-) diff --git a/[refs] b/[refs] index 0123ad3240d0..c93117046661 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b9031d9d87b24e24cd32ea15b5f4220a1e8da909 +refs/heads/master: 48e6c51bd326ce9faf07fbdf84d361c9755b7035 diff --git a/trunk/Documentation/networking/bridge.txt b/trunk/Documentation/networking/bridge.txt index bec69a8a1697..bdae2db4119c 100644 --- a/trunk/Documentation/networking/bridge.txt +++ b/trunk/Documentation/networking/bridge.txt @@ -1,6 +1,6 @@ In order to use the Ethernet bridging functionality, you'll need the userspace tools. These programs and documentation are available -at http://www.linux-foundation.org/en/Net:Bridge. The download page is +at http://bridge.sourceforge.net. The download page is http://prdownloads.sourceforge.net/bridge. If you still have questions, don't hesitate to post to the mailing list diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 46fa1797707a..0a6d2ca03cea 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -1611,7 +1611,7 @@ ETHERNET BRIDGE P: Stephen Hemminger M: shemminger@linux-foundation.org L: bridge@lists.linux-foundation.org -W: http://www.linux-foundation.org/en/Net:Bridge +W: http://bridge.sourceforge.net/ S: Maintained ETHERTEAM 16I DRIVER diff --git a/trunk/drivers/net/atlx/atl1.c b/trunk/drivers/net/atlx/atl1.c index 6ddc911e7d15..6e4c80d41b08 100644 --- a/trunk/drivers/net/atlx/atl1.c +++ b/trunk/drivers/net/atlx/atl1.c @@ -2023,7 +2023,6 @@ static void atl1_intr_rx(struct atl1_adapter *adapter) /* Good Receive */ pci_unmap_page(adapter->pdev, buffer_info->dma, buffer_info->length, PCI_DMA_FROMDEVICE); - buffer_info->dma = 0; skb = buffer_info->skb; length = le16_to_cpu(rrd->xsz.xsum_sz.pkt_size); diff --git a/trunk/drivers/net/cs89x0.c b/trunk/drivers/net/cs89x0.c index fba87abe78ee..348371fda597 100644 --- a/trunk/drivers/net/cs89x0.c +++ b/trunk/drivers/net/cs89x0.c @@ -1394,11 +1394,7 @@ net_open(struct net_device *dev) #endif if (!result) { printk(KERN_ERR "%s: EEPROM is configured for unavailable media\n", dev->name); -release_dma: -#if ALLOW_DMA - free_dma(dev->dma); -#endif -release_irq: + release_irq: #if ALLOW_DMA release_dma_buff(lp); #endif @@ -1446,12 +1442,12 @@ net_open(struct net_device *dev) if ((result = detect_bnc(dev)) != DETECTED_NONE) break; printk(KERN_ERR "%s: no media detected\n", dev->name); - goto release_dma; + goto release_irq; } switch(result) { case DETECTED_NONE: printk(KERN_ERR "%s: no network cable attached to configured media\n", dev->name); - goto release_dma; + goto release_irq; case DETECTED_RJ45H: printk(KERN_INFO "%s: using half-duplex 10Base-T (RJ-45)\n", dev->name); break; diff --git a/trunk/drivers/net/myri10ge/myri10ge.c b/trunk/drivers/net/myri10ge/myri10ge.c index e0d76c75aea0..36be6efc6398 100644 --- a/trunk/drivers/net/myri10ge/myri10ge.c +++ b/trunk/drivers/net/myri10ge/myri10ge.c @@ -75,7 +75,7 @@ #include "myri10ge_mcp.h" #include "myri10ge_mcp_gen_header.h" -#define MYRI10GE_VERSION_STR "1.3.99-1.347" +#define MYRI10GE_VERSION_STR "1.3.2-1.287" MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); MODULE_AUTHOR("Maintainer: help@myri.com"); diff --git a/trunk/drivers/net/sc92031.c b/trunk/drivers/net/sc92031.c index 61955f8d8011..b4b63805ee8f 100644 --- a/trunk/drivers/net/sc92031.c +++ b/trunk/drivers/net/sc92031.c @@ -972,7 +972,7 @@ static int sc92031_start_xmit(struct sk_buff *skb, struct net_device *dev) skb_copy_and_csum_dev(skb, priv->tx_bufs + entry * TX_BUF_SIZE); len = skb->len; - if (len < ETH_ZLEN) { + if (unlikely(len < ETH_ZLEN)) { memset(priv->tx_bufs + entry * TX_BUF_SIZE + len, 0, ETH_ZLEN - len); len = ETH_ZLEN; diff --git a/trunk/drivers/net/sfc/falcon_xmac.c b/trunk/drivers/net/sfc/falcon_xmac.c index 55c0d9760be8..dbdcee4b0f8d 100644 --- a/trunk/drivers/net/sfc/falcon_xmac.c +++ b/trunk/drivers/net/sfc/falcon_xmac.c @@ -459,7 +459,7 @@ static int falcon_check_xaui_link_up(struct efx_nic *efx) tries--; } - EFX_LOG(efx, "Failed to bring XAUI link back up in %d tries!\n", + EFX_ERR(efx, "Failed to bring XAUI link back up in %d tries!\n", max_tries); return 0; } diff --git a/trunk/drivers/net/sunhme.c b/trunk/drivers/net/sunhme.c index 1aa425be3067..b4e7f30ea4e8 100644 --- a/trunk/drivers/net/sunhme.c +++ b/trunk/drivers/net/sunhme.c @@ -111,7 +111,7 @@ static __inline__ void tx_add_log(struct happy_meal *hp, unsigned int a, unsigne struct hme_tx_logent *tlp; unsigned long flags; - local_irq_save(flags); + save_and_cli(flags); tlp = &tx_log[txlog_cur_entry]; tlp->tstamp = (unsigned int)jiffies; tlp->tx_new = hp->tx_new; @@ -119,7 +119,7 @@ static __inline__ void tx_add_log(struct happy_meal *hp, unsigned int a, unsigne tlp->action = a; tlp->status = s; txlog_cur_entry = (txlog_cur_entry + 1) & (TX_LOG_LEN - 1); - local_irq_restore(flags); + restore_flags(flags); } static __inline__ void tx_dump_log(void) { diff --git a/trunk/drivers/net/tulip/tulip_core.c b/trunk/drivers/net/tulip/tulip_core.c index 55670b5eb611..f9d13fa05d64 100644 --- a/trunk/drivers/net/tulip/tulip_core.c +++ b/trunk/drivers/net/tulip/tulip_core.c @@ -1729,15 +1729,12 @@ static int tulip_suspend (struct pci_dev *pdev, pm_message_t state) if (!dev) return -EINVAL; - if (!netif_running(dev)) - goto save_state; - - tulip_down(dev); + if (netif_running(dev)) + tulip_down(dev); netif_device_detach(dev); free_irq(dev->irq, dev); -save_state: pci_save_state(pdev); pci_disable_device(pdev); pci_set_power_state(pdev, pci_choose_state(pdev, state)); @@ -1757,9 +1754,6 @@ static int tulip_resume(struct pci_dev *pdev) pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); - if (!netif_running(dev)) - return 0; - if ((retval = pci_enable_device(pdev))) { printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); return retval; diff --git a/trunk/drivers/net/ucc_geth_ethtool.c b/trunk/drivers/net/ucc_geth_ethtool.c index f5839c4a5cbd..299b7f176950 100644 --- a/trunk/drivers/net/ucc_geth_ethtool.c +++ b/trunk/drivers/net/ucc_geth_ethtool.c @@ -73,7 +73,6 @@ static char tx_fw_stat_gstrings[][ETH_GSTRING_LEN] = { "tx-frames-ok", "tx-excessive-differ-frames", "tx-256-511-frames", - "tx-512-1023-frames", "tx-1024-1518-frames", "tx-jumbo-frames", }; @@ -309,7 +308,7 @@ static void uec_get_strings(struct net_device *netdev, u32 stringset, u8 *buf) buf += UEC_TX_FW_STATS_LEN * ETH_GSTRING_LEN; } if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX) - memcpy(buf, rx_fw_stat_gstrings, UEC_RX_FW_STATS_LEN * + memcpy(buf, tx_fw_stat_gstrings, UEC_RX_FW_STATS_LEN * ETH_GSTRING_LEN); } diff --git a/trunk/drivers/net/virtio_net.c b/trunk/drivers/net/virtio_net.c index 5450eac9e263..fe7cdf2a2a23 100644 --- a/trunk/drivers/net/virtio_net.c +++ b/trunk/drivers/net/virtio_net.c @@ -47,9 +47,6 @@ struct virtnet_info /* Number of input buffers, and max we've ever had. */ unsigned int num, max; - /* For cleaning up after transmission. */ - struct tasklet_struct tasklet; - /* Receive & send queues. */ struct sk_buff_head recv; struct sk_buff_head send; @@ -71,13 +68,8 @@ static void skb_xmit_done(struct virtqueue *svq) /* Suppress further interrupts. */ svq->vq_ops->disable_cb(svq); - /* We were waiting for more output buffers. */ netif_wake_queue(vi->dev); - - /* Make sure we re-xmit last_xmit_skb: if there are no more packets - * queued, start_xmit won't be called. */ - tasklet_schedule(&vi->tasklet); } static void receive_skb(struct net_device *dev, struct sk_buff *skb, @@ -286,18 +278,6 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb); } -static void xmit_tasklet(unsigned long data) -{ - struct virtnet_info *vi = (void *)data; - - netif_tx_lock_bh(vi->dev); - if (vi->last_xmit_skb && xmit_skb(vi, vi->last_xmit_skb) == 0) { - vi->svq->vq_ops->kick(vi->svq); - vi->last_xmit_skb = NULL; - } - netif_tx_unlock_bh(vi->dev); -} - static int start_xmit(struct sk_buff *skb, struct net_device *dev) { struct virtnet_info *vi = netdev_priv(dev); @@ -307,25 +287,21 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev) free_old_xmit_skbs(vi); /* If we has a buffer left over from last time, send it now. */ - if (unlikely(vi->last_xmit_skb)) { + if (vi->last_xmit_skb) { if (xmit_skb(vi, vi->last_xmit_skb) != 0) { /* Drop this skb: we only queue one. */ vi->dev->stats.tx_dropped++; kfree_skb(skb); - skb = NULL; goto stop_queue; } vi->last_xmit_skb = NULL; } /* Put new one in send queue and do transmit */ - if (likely(skb)) { - __skb_queue_head(&vi->send, skb); - if (xmit_skb(vi, skb) != 0) { - vi->last_xmit_skb = skb; - skb = NULL; - goto stop_queue; - } + __skb_queue_head(&vi->send, skb); + if (xmit_skb(vi, skb) != 0) { + vi->last_xmit_skb = skb; + goto stop_queue; } done: vi->svq->vq_ops->kick(vi->svq); @@ -452,8 +428,6 @@ static int virtnet_probe(struct virtio_device *vdev) skb_queue_head_init(&vi->recv); skb_queue_head_init(&vi->send); - tasklet_init(&vi->tasklet, xmit_tasklet, (unsigned long)vi); - err = register_netdev(dev); if (err) { pr_debug("virtio_net: registering device failed\n"); diff --git a/trunk/drivers/net/wireless/b43legacy/main.c b/trunk/drivers/net/wireless/b43legacy/main.c index 14a5eea2573e..204077c13870 100644 --- a/trunk/drivers/net/wireless/b43legacy/main.c +++ b/trunk/drivers/net/wireless/b43legacy/main.c @@ -3039,7 +3039,6 @@ static void b43legacy_set_pretbtt(struct b43legacy_wldev *dev) /* Locking: wl->mutex */ static void b43legacy_wireless_core_exit(struct b43legacy_wldev *dev) { - struct b43legacy_wl *wl = dev->wl; struct b43legacy_phy *phy = &dev->phy; u32 macctl; @@ -3054,12 +3053,6 @@ static void b43legacy_wireless_core_exit(struct b43legacy_wldev *dev) macctl |= B43legacy_MACCTL_PSM_JMP0; b43legacy_write32(dev, B43legacy_MMIO_MACCTL, macctl); - mutex_unlock(&wl->mutex); - /* Must unlock as it would otherwise deadlock. No races here. - * Cancel possibly pending workqueues. */ - cancel_work_sync(&dev->restart_work); - mutex_lock(&wl->mutex); - b43legacy_leds_exit(dev); b43legacy_rng_exit(dev->wl); b43legacy_pio_free(dev); @@ -3486,6 +3479,8 @@ static void b43legacy_chip_reset(struct work_struct *work) } } out: + if (err) + wl->current_dev = NULL; /* Failed to init the dev. */ mutex_unlock(&wl->mutex); if (err) b43legacyerr(wl, "Controller restart FAILED\n"); @@ -3618,9 +3613,11 @@ static void b43legacy_one_core_detach(struct ssb_device *dev) struct b43legacy_wldev *wldev; struct b43legacy_wl *wl; + /* Do not cancel ieee80211-workqueue based work here. + * See comment in b43legacy_remove(). */ + wldev = ssb_get_drvdata(dev); wl = wldev->wl; - cancel_work_sync(&wldev->restart_work); b43legacy_debugfs_remove_device(wldev); b43legacy_wireless_core_detach(wldev); list_del(&wldev->list); @@ -3789,6 +3786,10 @@ static void b43legacy_remove(struct ssb_device *dev) struct b43legacy_wl *wl = ssb_get_devtypedata(dev); struct b43legacy_wldev *wldev = ssb_get_drvdata(dev); + /* We must cancel any work here before unregistering from ieee80211, + * as the ieee80211 unreg will destroy the workqueue. */ + cancel_work_sync(&wldev->restart_work); + B43legacy_WARN_ON(!wl); if (wl->current_dev == wldev) ieee80211_unregister_hw(wl->hw); diff --git a/trunk/include/linux/in_route.h b/trunk/include/linux/in_route.h index b261b8c915f0..61f25c30a2a0 100644 --- a/trunk/include/linux/in_route.h +++ b/trunk/include/linux/in_route.h @@ -10,19 +10,19 @@ #define RTCF_NOPMTUDISC RTM_F_NOPMTUDISC #define RTCF_NOTIFY 0x00010000 -#define RTCF_DIRECTDST 0x00020000 /* unused */ +#define RTCF_DIRECTDST 0x00020000 #define RTCF_REDIRECTED 0x00040000 -#define RTCF_TPROXY 0x00080000 /* unused */ +#define RTCF_TPROXY 0x00080000 -#define RTCF_FAST 0x00200000 /* unused */ -#define RTCF_MASQ 0x00400000 /* unused */ -#define RTCF_SNAT 0x00800000 /* unused */ +#define RTCF_FAST 0x00200000 +#define RTCF_MASQ 0x00400000 +#define RTCF_SNAT 0x00800000 #define RTCF_DOREDIRECT 0x01000000 #define RTCF_DIRECTSRC 0x04000000 #define RTCF_DNAT 0x08000000 #define RTCF_BROADCAST 0x10000000 #define RTCF_MULTICAST 0x20000000 -#define RTCF_REJECT 0x40000000 /* unused */ +#define RTCF_REJECT 0x40000000 #define RTCF_LOCAL 0x80000000 #define RTCF_NAT (RTCF_DNAT|RTCF_SNAT) diff --git a/trunk/include/linux/inetdevice.h b/trunk/include/linux/inetdevice.h index c6f51ad52d5b..7009b0cdd06f 100644 --- a/trunk/include/linux/inetdevice.h +++ b/trunk/include/linux/inetdevice.h @@ -117,6 +117,7 @@ struct in_ifaddr __be32 ifa_address; __be32 ifa_mask; __be32 ifa_broadcast; + __be32 ifa_anycast; unsigned char ifa_scope; unsigned char ifa_flags; unsigned char ifa_prefixlen; diff --git a/trunk/include/linux/rtnetlink.h b/trunk/include/linux/rtnetlink.h index a2aec2c0cfb5..44c81c744538 100644 --- a/trunk/include/linux/rtnetlink.h +++ b/trunk/include/linux/rtnetlink.h @@ -267,10 +267,10 @@ enum rtattr_type_t RTA_PREFSRC, RTA_METRICS, RTA_MULTIPATH, - RTA_PROTOINFO, /* no longer used */ + RTA_PROTOINFO, RTA_FLOW, RTA_CACHEINFO, - RTA_SESSION, /* no longer used */ + RTA_SESSION, RTA_MP_ALGO, /* no longer used */ RTA_TABLE, __RTA_MAX diff --git a/trunk/include/net/addrconf.h b/trunk/include/net/addrconf.h index bbd3d583c6e6..0a2f0372df31 100644 --- a/trunk/include/net/addrconf.h +++ b/trunk/include/net/addrconf.h @@ -94,28 +94,6 @@ extern void addrconf_join_solict(struct net_device *dev, extern void addrconf_leave_solict(struct inet6_dev *idev, struct in6_addr *addr); -static inline unsigned long addrconf_timeout_fixup(u32 timeout, - unsigned unit) -{ - if (timeout == 0xffffffff) - return ~0UL; - - /* - * Avoid arithmetic overflow. - * Assuming unit is constant and non-zero, this "if" statement - * will go away on 64bit archs. - */ - if (0xfffffffe > LONG_MAX / unit && timeout > LONG_MAX / unit) - return LONG_MAX / unit; - - return timeout; -} - -static inline int addrconf_finite_timeout(unsigned long timeout) -{ - return ~timeout; -} - /* * IPv6 Address Label subsystem (addrlabel.c) */ diff --git a/trunk/include/net/genetlink.h b/trunk/include/net/genetlink.h index 747c255d1df0..decdda546829 100644 --- a/trunk/include/net/genetlink.h +++ b/trunk/include/net/genetlink.h @@ -162,9 +162,9 @@ static inline int genlmsg_end(struct sk_buff *skb, void *hdr) * @skb: socket buffer the message is stored in * @hdr: generic netlink message header */ -static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr) +static inline int genlmsg_cancel(struct sk_buff *skb, void *hdr) { - nlmsg_cancel(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN); + return nlmsg_cancel(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN); } /** diff --git a/trunk/include/net/netlink.h b/trunk/include/net/netlink.h index dfc3701dfcc3..112dcdf7e34e 100644 --- a/trunk/include/net/netlink.h +++ b/trunk/include/net/netlink.h @@ -556,12 +556,14 @@ static inline void *nlmsg_get_pos(struct sk_buff *skb) * @skb: socket buffer the message is stored in * @mark: mark to trim to * - * Trims the message to the provided mark. + * Trims the message to the provided mark. Returns -1. */ -static inline void nlmsg_trim(struct sk_buff *skb, const void *mark) +static inline int nlmsg_trim(struct sk_buff *skb, const void *mark) { if (mark) skb_trim(skb, (unsigned char *) mark - skb->data); + + return -1; } /** @@ -570,11 +572,11 @@ static inline void nlmsg_trim(struct sk_buff *skb, const void *mark) * @nlh: netlink message header * * Removes the complete netlink message including all - * attributes from the socket buffer again. + * attributes from the socket buffer again. Returns -1. */ -static inline void nlmsg_cancel(struct sk_buff *skb, struct nlmsghdr *nlh) +static inline int nlmsg_cancel(struct sk_buff *skb, struct nlmsghdr *nlh) { - nlmsg_trim(skb, nlh); + return nlmsg_trim(skb, nlh); } /** @@ -773,7 +775,7 @@ static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype, int nested_len = nla_len(nla) - NLA_ALIGN(len); if (nested_len < 0) - return -EINVAL; + return -1; if (nested_len >= nla_attr_size(0)) return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len), nested_len, policy); @@ -1078,11 +1080,11 @@ static inline int nla_nest_compat_end(struct sk_buff *skb, struct nlattr *start) * @start: container attribute * * Removes the container attribute and including all nested - * attributes. Returns -EMSGSIZE + * attributes. Returns -1. */ -static inline void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start) +static inline int nla_nest_cancel(struct sk_buff *skb, struct nlattr *start) { - nlmsg_trim(skb, start); + return nlmsg_trim(skb, start); } /** diff --git a/trunk/include/net/sctp/structs.h b/trunk/include/net/sctp/structs.h index 7f25195f9855..0ce0443c5b79 100644 --- a/trunk/include/net/sctp/structs.h +++ b/trunk/include/net/sctp/structs.h @@ -548,8 +548,7 @@ struct sctp_af { struct dst_entry *(*get_dst) (struct sctp_association *asoc, union sctp_addr *daddr, union sctp_addr *saddr); - void (*get_saddr) (struct sctp_sock *sk, - struct sctp_association *asoc, + void (*get_saddr) (struct sctp_association *asoc, struct dst_entry *dst, union sctp_addr *daddr, union sctp_addr *saddr); @@ -588,7 +587,6 @@ struct sctp_af { int (*is_ce) (const struct sk_buff *sk); void (*seq_dump_addr)(struct seq_file *seq, union sctp_addr *addr); - void (*ecn_capable)(struct sock *sk); __u16 net_header_len; int sockaddr_len; sa_family_t sa_family; @@ -903,10 +901,7 @@ struct sctp_transport { * calculation completes (i.e. the DATA chunk * is SACK'd) clear this flag. */ - __u8 rto_pending; - - /* Flag to track the current fast recovery state */ - __u8 fast_recovery; + int rto_pending; /* * These are the congestion stats. @@ -925,9 +920,6 @@ struct sctp_transport { /* Data that has been sent, but not acknowledged. */ __u32 flight_size; - /* TSN marking the fast recovery exit point */ - __u32 fast_recovery_exit; - /* Destination */ struct dst_entry *dst; /* Source address. */ @@ -1052,7 +1044,7 @@ void sctp_transport_route(struct sctp_transport *, union sctp_addr *, struct sctp_sock *); void sctp_transport_pmtu(struct sctp_transport *); void sctp_transport_free(struct sctp_transport *); -void sctp_transport_reset_timers(struct sctp_transport *, int); +void sctp_transport_reset_timers(struct sctp_transport *); void sctp_transport_hold(struct sctp_transport *); void sctp_transport_put(struct sctp_transport *); void sctp_transport_update_rto(struct sctp_transport *, __u32); @@ -1142,9 +1134,6 @@ struct sctp_outq { /* How many unackd bytes do we have in-flight? */ __u32 outstanding_bytes; - /* Are we doing fast-rtx on this queue */ - char fast_rtx; - /* Corked? */ char cork; diff --git a/trunk/include/net/transp_v6.h b/trunk/include/net/transp_v6.h index 112934a3288d..27394e0447d8 100644 --- a/trunk/include/net/transp_v6.h +++ b/trunk/include/net/transp_v6.h @@ -40,8 +40,7 @@ extern int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb); -extern int datagram_send_ctl(struct net *net, - struct msghdr *msg, +extern int datagram_send_ctl(struct msghdr *msg, struct flowi *fl, struct ipv6_txoptions *opt, int *hlimit, int *tclass); diff --git a/trunk/include/net/udp.h b/trunk/include/net/udp.h index ccce83707046..3e55a99b0ba3 100644 --- a/trunk/include/net/udp.h +++ b/trunk/include/net/udp.h @@ -135,7 +135,6 @@ extern void udp_err(struct sk_buff *, u32); extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len); -extern void udp_flush_pending_frames(struct sock *sk); extern int udp_rcv(struct sk_buff *skb); extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); diff --git a/trunk/net/core/neighbour.c b/trunk/net/core/neighbour.c index 65f01f71b3f3..5d9d7130bd6e 100644 --- a/trunk/net/core/neighbour.c +++ b/trunk/net/core/neighbour.c @@ -1714,8 +1714,7 @@ static int neightbl_fill_parms(struct sk_buff *skb, struct neigh_parms *parms) return nla_nest_end(skb, nest); nla_put_failure: - nla_nest_cancel(skb, nest); - return -EMSGSIZE; + return nla_nest_cancel(skb, nest); } static int neightbl_fill_info(struct sk_buff *skb, struct neigh_table *tbl, @@ -2058,9 +2057,9 @@ static int neigh_fill_info(struct sk_buff *skb, struct neighbour *neigh, goto nla_put_failure; } - ci.ndm_used = jiffies_to_clock_t(now - neigh->used); - ci.ndm_confirmed = jiffies_to_clock_t(now - neigh->confirmed); - ci.ndm_updated = jiffies_to_clock_t(now - neigh->updated); + ci.ndm_used = now - neigh->used; + ci.ndm_confirmed = now - neigh->confirmed; + ci.ndm_updated = now - neigh->updated; ci.ndm_refcnt = atomic_read(&neigh->refcnt) - 1; read_unlock_bh(&neigh->lock); diff --git a/trunk/net/core/rtnetlink.c b/trunk/net/core/rtnetlink.c index a9a77216310e..cf857c4dc7b1 100644 --- a/trunk/net/core/rtnetlink.c +++ b/trunk/net/core/rtnetlink.c @@ -498,8 +498,7 @@ int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics) return nla_nest_end(skb, mx); nla_put_failure: - nla_nest_cancel(skb, mx); - return -EMSGSIZE; + return nla_nest_cancel(skb, mx); } int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id, diff --git a/trunk/net/core/user_dma.c b/trunk/net/core/user_dma.c index c77aff9c6eb3..0ad1cd57bc39 100644 --- a/trunk/net/core/user_dma.c +++ b/trunk/net/core/user_dma.c @@ -75,7 +75,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan, end = start + skb_shinfo(skb)->frags[i].size; copy = end - offset; - if (copy > 0) { + if ((copy = end - offset) > 0) { skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; struct page *page = frag->page; diff --git a/trunk/net/ipv4/devinet.c b/trunk/net/ipv4/devinet.c index 79a7ef6209ff..6848e4760f34 100644 --- a/trunk/net/ipv4/devinet.c +++ b/trunk/net/ipv4/devinet.c @@ -90,6 +90,7 @@ static const struct nla_policy ifa_ipv4_policy[IFA_MAX+1] = { [IFA_LOCAL] = { .type = NLA_U32 }, [IFA_ADDRESS] = { .type = NLA_U32 }, [IFA_BROADCAST] = { .type = NLA_U32 }, + [IFA_ANYCAST] = { .type = NLA_U32 }, [IFA_LABEL] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, }; @@ -535,6 +536,9 @@ static struct in_ifaddr *rtm_to_ifaddr(struct net *net, struct nlmsghdr *nlh) if (tb[IFA_BROADCAST]) ifa->ifa_broadcast = nla_get_be32(tb[IFA_BROADCAST]); + if (tb[IFA_ANYCAST]) + ifa->ifa_anycast = nla_get_be32(tb[IFA_ANYCAST]); + if (tb[IFA_LABEL]) nla_strlcpy(ifa->ifa_label, tb[IFA_LABEL], IFNAMSIZ); else @@ -741,6 +745,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg) break; inet_del_ifa(in_dev, ifap, 0); ifa->ifa_broadcast = 0; + ifa->ifa_anycast = 0; ifa->ifa_scope = 0; } @@ -1108,6 +1113,7 @@ static inline size_t inet_nlmsg_size(void) + nla_total_size(4) /* IFA_ADDRESS */ + nla_total_size(4) /* IFA_LOCAL */ + nla_total_size(4) /* IFA_BROADCAST */ + + nla_total_size(4) /* IFA_ANYCAST */ + nla_total_size(IFNAMSIZ); /* IFA_LABEL */ } @@ -1137,6 +1143,9 @@ static int inet_fill_ifaddr(struct sk_buff *skb, struct in_ifaddr *ifa, if (ifa->ifa_broadcast) NLA_PUT_BE32(skb, IFA_BROADCAST, ifa->ifa_broadcast); + if (ifa->ifa_anycast) + NLA_PUT_BE32(skb, IFA_ANYCAST, ifa->ifa_anycast); + if (ifa->ifa_label[0]) NLA_PUT_STRING(skb, IFA_LABEL, ifa->ifa_label); diff --git a/trunk/net/ipv4/fib_frontend.c b/trunk/net/ipv4/fib_frontend.c index 0b2ac6a3d903..0f1557a4ac7a 100644 --- a/trunk/net/ipv4/fib_frontend.c +++ b/trunk/net/ipv4/fib_frontend.c @@ -506,6 +506,7 @@ const struct nla_policy rtm_ipv4_policy[RTA_MAX+1] = { [RTA_PREFSRC] = { .type = NLA_U32 }, [RTA_METRICS] = { .type = NLA_NESTED }, [RTA_MULTIPATH] = { .len = sizeof(struct rtnexthop) }, + [RTA_PROTOINFO] = { .type = NLA_U32 }, [RTA_FLOW] = { .type = NLA_U32 }, }; diff --git a/trunk/net/ipv4/route.c b/trunk/net/ipv4/route.c index 96be336064fb..df41026b60db 100644 --- a/trunk/net/ipv4/route.c +++ b/trunk/net/ipv4/route.c @@ -1792,7 +1792,7 @@ static int __mkroute_input(struct sk_buff *skb, if (err) flags |= RTCF_DIRECTSRC; - if (out_dev == in_dev && err && + if (out_dev == in_dev && err && !(flags & RTCF_MASQ) && (IN_DEV_SHARED_MEDIA(out_dev) || inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res)))) flags |= RTCF_DOREDIRECT; diff --git a/trunk/net/ipv4/tcp_input.c b/trunk/net/ipv4/tcp_input.c index eba873e9b560..b54d9d37b636 100644 --- a/trunk/net/ipv4/tcp_input.c +++ b/trunk/net/ipv4/tcp_input.c @@ -1392,9 +1392,9 @@ static struct sk_buff *tcp_maybe_skipping_dsack(struct sk_buff *skb, if (before(next_dup->start_seq, skip_to_seq)) { skb = tcp_sacktag_skip(skb, sk, next_dup->start_seq, fack_count); - skb = tcp_sacktag_walk(skb, sk, NULL, - next_dup->start_seq, next_dup->end_seq, - 1, fack_count, reord, flag); + tcp_sacktag_walk(skb, sk, NULL, + next_dup->start_seq, next_dup->end_seq, + 1, fack_count, reord, flag); } return skb; @@ -2483,20 +2483,6 @@ static inline void tcp_complete_cwr(struct sock *sk) tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR); } -static void tcp_try_keep_open(struct sock *sk) -{ - struct tcp_sock *tp = tcp_sk(sk); - int state = TCP_CA_Open; - - if (tcp_left_out(tp) || tp->retrans_out || tp->undo_marker) - state = TCP_CA_Disorder; - - if (inet_csk(sk)->icsk_ca_state != state) { - tcp_set_ca_state(sk, state); - tp->high_seq = tp->snd_nxt; - } -} - static void tcp_try_to_open(struct sock *sk, int flag) { struct tcp_sock *tp = tcp_sk(sk); @@ -2510,7 +2496,15 @@ static void tcp_try_to_open(struct sock *sk, int flag) tcp_enter_cwr(sk, 1); if (inet_csk(sk)->icsk_ca_state != TCP_CA_CWR) { - tcp_try_keep_open(sk); + int state = TCP_CA_Open; + + if (tcp_left_out(tp) || tp->retrans_out || tp->undo_marker) + state = TCP_CA_Disorder; + + if (inet_csk(sk)->icsk_ca_state != state) { + tcp_set_ca_state(sk, state); + tp->high_seq = tp->snd_nxt; + } tcp_moderate_cwnd(tp); } else { tcp_cwnd_down(sk, flag); @@ -3316,11 +3310,8 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) return 1; old_ack: - if (TCP_SKB_CB(skb)->sacked) { + if (TCP_SKB_CB(skb)->sacked) tcp_sacktag_write_queue(sk, skb, prior_snd_una); - if (icsk->icsk_ca_state == TCP_CA_Open) - tcp_try_keep_open(sk); - } uninteresting_ack: SOCK_DEBUG(sk, "Ack %u out of %u:%u\n", ack, tp->snd_una, tp->snd_nxt); diff --git a/trunk/net/ipv4/tunnel4.c b/trunk/net/ipv4/tunnel4.c index cb1f0e83830b..d3b709a6f264 100644 --- a/trunk/net/ipv4/tunnel4.c +++ b/trunk/net/ipv4/tunnel4.c @@ -97,7 +97,7 @@ static int tunnel64_rcv(struct sk_buff *skb) { struct xfrm_tunnel *handler; - if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) + if (!pskb_may_pull(skb, sizeof(struct iphdr))) goto drop; for (handler = tunnel64_handlers; handler; handler = handler->next) diff --git a/trunk/net/ipv4/udp.c b/trunk/net/ipv4/udp.c index 56fcda3694ba..db1cb7c96d63 100644 --- a/trunk/net/ipv4/udp.c +++ b/trunk/net/ipv4/udp.c @@ -420,7 +420,7 @@ void udp_err(struct sk_buff *skb, u32 info) /* * Throw away all pending data and cancel the corking. Socket is locked. */ -void udp_flush_pending_frames(struct sock *sk) +static void udp_flush_pending_frames(struct sock *sk) { struct udp_sock *up = udp_sk(sk); @@ -430,7 +430,6 @@ void udp_flush_pending_frames(struct sock *sk) ip_flush_pending_frames(sk); } } -EXPORT_SYMBOL(udp_flush_pending_frames); /** * udp4_hwcsum_outgoing - handle outgoing HW checksumming diff --git a/trunk/net/ipv6/addrconf.c b/trunk/net/ipv6/addrconf.c index 147588f4c7c0..3a835578fd1c 100644 --- a/trunk/net/ipv6/addrconf.c +++ b/trunk/net/ipv6/addrconf.c @@ -731,13 +731,8 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) onlink = -1; spin_lock(&ifa->lock); - - lifetime = addrconf_timeout_fixup(ifa->valid_lft, HZ); - /* - * Note: Because this address is - * not permanent, lifetime < - * LONG_MAX / HZ here. - */ + lifetime = min_t(unsigned long, + ifa->valid_lft, 0x7fffffffUL/HZ); if (time_before(expires, ifa->tstamp + lifetime * HZ)) expires = ifa->tstamp + lifetime * HZ; @@ -1727,6 +1722,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len) __u32 valid_lft; __u32 prefered_lft; int addr_type; + unsigned long rt_expires; struct inet6_dev *in6_dev; pinfo = (struct prefix_info *) opt; @@ -1768,23 +1764,28 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len) * 2) Configure prefixes with the auto flag set */ - if (pinfo->onlink) { - struct rt6_info *rt; - unsigned long rt_expires; - + if (valid_lft == INFINITY_LIFE_TIME) + rt_expires = ~0UL; + else if (valid_lft >= 0x7FFFFFFF/HZ) { /* Avoid arithmetic overflow. Really, we could * save rt_expires in seconds, likely valid_lft, * but it would require division in fib gc, that it * not good. */ - if (HZ > USER_HZ) - rt_expires = addrconf_timeout_fixup(valid_lft, HZ); - else - rt_expires = addrconf_timeout_fixup(valid_lft, USER_HZ); + rt_expires = 0x7FFFFFFF - (0x7FFFFFFF % HZ); + } else + rt_expires = valid_lft * HZ; - if (addrconf_finite_timeout(rt_expires)) - rt_expires *= HZ; + /* + * We convert this (in jiffies) to clock_t later. + * Avoid arithmetic overflow there as well. + * Overflow can happen only if HZ < USER_HZ. + */ + if (HZ < USER_HZ && ~rt_expires && rt_expires > 0x7FFFFFFF / USER_HZ) + rt_expires = 0x7FFFFFFF / USER_HZ; + if (pinfo->onlink) { + struct rt6_info *rt; rt = rt6_lookup(dev_net(dev), &pinfo->prefix, NULL, dev->ifindex, 1); @@ -1793,7 +1794,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len) if (valid_lft == 0) { ip6_del_rt(rt); rt = NULL; - } else if (addrconf_finite_timeout(rt_expires)) { + } else if (~rt_expires) { /* not infinity */ rt->rt6i_expires = jiffies + rt_expires; rt->rt6i_flags |= RTF_EXPIRES; @@ -1802,9 +1803,9 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len) rt->rt6i_expires = 0; } } else if (valid_lft) { - clock_t expires = 0; int flags = RTF_ADDRCONF | RTF_PREFIX_RT; - if (addrconf_finite_timeout(rt_expires)) { + clock_t expires = 0; + if (~rt_expires) { /* not infinity */ flags |= RTF_EXPIRES; expires = jiffies_to_clock_t(rt_expires); @@ -2026,7 +2027,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg) * Manual configuration of address on an interface */ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx, - unsigned int plen, __u8 ifa_flags, __u32 prefered_lft, + int plen, __u8 ifa_flags, __u32 prefered_lft, __u32 valid_lft) { struct inet6_ifaddr *ifp; @@ -2035,13 +2036,9 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx, int scope; u32 flags; clock_t expires; - unsigned long timeout; ASSERT_RTNL(); - if (plen > 128) - return -EINVAL; - /* check the lifetime */ if (!valid_lft || prefered_lft > valid_lft) return -EINVAL; @@ -2055,23 +2052,22 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx, scope = ipv6_addr_scope(pfx); - timeout = addrconf_timeout_fixup(valid_lft, HZ); - if (addrconf_finite_timeout(timeout)) { - expires = jiffies_to_clock_t(timeout * HZ); - valid_lft = timeout; - flags = RTF_EXPIRES; - } else { - expires = 0; - flags = 0; + if (valid_lft == INFINITY_LIFE_TIME) { ifa_flags |= IFA_F_PERMANENT; + flags = 0; + expires = 0; + } else { + if (valid_lft >= 0x7FFFFFFF/HZ) + valid_lft = 0x7FFFFFFF/HZ; + flags = RTF_EXPIRES; + expires = jiffies_to_clock_t(valid_lft * HZ); } - timeout = addrconf_timeout_fixup(prefered_lft, HZ); - if (addrconf_finite_timeout(timeout)) { - if (timeout == 0) - ifa_flags |= IFA_F_DEPRECATED; - prefered_lft = timeout; - } + if (prefered_lft == 0) + ifa_flags |= IFA_F_DEPRECATED; + else if ((prefered_lft >= 0x7FFFFFFF/HZ) && + (prefered_lft != INFINITY_LIFE_TIME)) + prefered_lft = 0x7FFFFFFF/HZ; ifp = ipv6_add_addr(idev, pfx, plen, scope, ifa_flags); @@ -2099,15 +2095,12 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx, } static int inet6_addr_del(struct net *net, int ifindex, struct in6_addr *pfx, - unsigned int plen) + int plen) { struct inet6_ifaddr *ifp; struct inet6_dev *idev; struct net_device *dev; - if (plen > 128) - return -EINVAL; - dev = __dev_get_by_index(net, ifindex); if (!dev) return -ENODEV; @@ -3176,28 +3169,26 @@ static int inet6_addr_modify(struct inet6_ifaddr *ifp, u8 ifa_flags, { u32 flags; clock_t expires; - unsigned long timeout; if (!valid_lft || (prefered_lft > valid_lft)) return -EINVAL; - timeout = addrconf_timeout_fixup(valid_lft, HZ); - if (addrconf_finite_timeout(timeout)) { - expires = jiffies_to_clock_t(timeout * HZ); - valid_lft = timeout; - flags = RTF_EXPIRES; - } else { - expires = 0; - flags = 0; + if (valid_lft == INFINITY_LIFE_TIME) { ifa_flags |= IFA_F_PERMANENT; + flags = 0; + expires = 0; + } else { + if (valid_lft >= 0x7FFFFFFF/HZ) + valid_lft = 0x7FFFFFFF/HZ; + flags = RTF_EXPIRES; + expires = jiffies_to_clock_t(valid_lft * HZ); } - timeout = addrconf_timeout_fixup(prefered_lft, HZ); - if (addrconf_finite_timeout(timeout)) { - if (timeout == 0) - ifa_flags |= IFA_F_DEPRECATED; - prefered_lft = timeout; - } + if (prefered_lft == 0) + ifa_flags |= IFA_F_DEPRECATED; + else if ((prefered_lft >= 0x7FFFFFFF/HZ) && + (prefered_lft != INFINITY_LIFE_TIME)) + prefered_lft = 0x7FFFFFFF/HZ; spin_lock_bh(&ifp->lock); ifp->flags = (ifp->flags & ~(IFA_F_DEPRECATED | IFA_F_PERMANENT | IFA_F_NODAD | IFA_F_HOMEADDRESS)) | ifa_flags; diff --git a/trunk/net/ipv6/datagram.c b/trunk/net/ipv6/datagram.c index b9c2de84a8a2..94fa6ae77cfe 100644 --- a/trunk/net/ipv6/datagram.c +++ b/trunk/net/ipv6/datagram.c @@ -496,8 +496,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb) return 0; } -int datagram_send_ctl(struct net *net, - struct msghdr *msg, struct flowi *fl, +int datagram_send_ctl(struct msghdr *msg, struct flowi *fl, struct ipv6_txoptions *opt, int *hlimit, int *tclass) { @@ -510,6 +509,7 @@ int datagram_send_ctl(struct net *net, for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) { int addr_type; + struct net_device *dev = NULL; if (!CMSG_OK(msg, cmsg)) { err = -EINVAL; @@ -522,9 +522,6 @@ int datagram_send_ctl(struct net *net, switch (cmsg->cmsg_type) { case IPV6_PKTINFO: case IPV6_2292PKTINFO: - { - struct net_device *dev = NULL; - if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct in6_pktinfo))) { err = -EINVAL; goto exit_f; @@ -538,32 +535,32 @@ int datagram_send_ctl(struct net *net, fl->oif = src_info->ipi6_ifindex; } - addr_type = __ipv6_addr_type(&src_info->ipi6_addr); + addr_type = ipv6_addr_type(&src_info->ipi6_addr); - if (fl->oif) { - dev = dev_get_by_index(net, fl->oif); - if (!dev) - return -ENODEV; - } else if (addr_type & IPV6_ADDR_LINKLOCAL) - return -EINVAL; + if (addr_type == IPV6_ADDR_ANY) + break; - if (addr_type != IPV6_ADDR_ANY) { - int strict = __ipv6_addr_src_scope(addr_type) <= IPV6_ADDR_SCOPE_LINKLOCAL; - if (!ipv6_chk_addr(net, &src_info->ipi6_addr, - strict ? dev : NULL, 0)) - err = -EINVAL; - else - ipv6_addr_copy(&fl->fl6_src, &src_info->ipi6_addr); + if (addr_type & IPV6_ADDR_LINKLOCAL) { + if (!src_info->ipi6_ifindex) + return -EINVAL; + else { + dev = dev_get_by_index(&init_net, src_info->ipi6_ifindex); + if (!dev) + return -ENODEV; + } + } + if (!ipv6_chk_addr(&init_net, &src_info->ipi6_addr, + dev, 0)) { + if (dev) + dev_put(dev); + err = -EINVAL; + goto exit_f; } - if (dev) dev_put(dev); - if (err) - goto exit_f; - + ipv6_addr_copy(&fl->fl6_src, &src_info->ipi6_addr); break; - } case IPV6_FLOWINFO: if (cmsg->cmsg_len < CMSG_LEN(4)) { diff --git a/trunk/net/ipv6/ip6_flowlabel.c b/trunk/net/ipv6/ip6_flowlabel.c index 37a4e777e347..eb7a940310f4 100644 --- a/trunk/net/ipv6/ip6_flowlabel.c +++ b/trunk/net/ipv6/ip6_flowlabel.c @@ -354,7 +354,7 @@ fl_create(struct net *net, struct in6_flowlabel_req *freq, char __user *optval, msg.msg_control = (void*)(fl->opt+1); flowi.oif = 0; - err = datagram_send_ctl(net, &msg, &flowi, fl->opt, &junk, &junk); + err = datagram_send_ctl(&msg, &flowi, fl->opt, &junk, &junk); if (err) goto done; err = -EINVAL; diff --git a/trunk/net/ipv6/ipv6_sockglue.c b/trunk/net/ipv6/ipv6_sockglue.c index 26b83e512a09..56d55fecf8ec 100644 --- a/trunk/net/ipv6/ipv6_sockglue.c +++ b/trunk/net/ipv6/ipv6_sockglue.c @@ -161,17 +161,9 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, struct ipv6_txoptions *opt; struct sk_buff *pktopt; - if (sk->sk_type == SOCK_RAW) - break; - - if (sk->sk_protocol == IPPROTO_UDP || - sk->sk_protocol == IPPROTO_UDPLITE) { - struct udp_sock *up = udp_sk(sk); - if (up->pending == AF_INET6) { - retv = -EBUSY; - break; - } - } else if (sk->sk_protocol != IPPROTO_TCP) + if (sk->sk_protocol != IPPROTO_UDP && + sk->sk_protocol != IPPROTO_UDPLITE && + sk->sk_protocol != IPPROTO_TCP) break; if (sk->sk_state != TCP_ESTABLISHED) { @@ -424,7 +416,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, msg.msg_controllen = optlen; msg.msg_control = (void*)(opt+1); - retv = datagram_send_ctl(net, &msg, &fl, opt, &junk, &junk); + retv = datagram_send_ctl(&msg, &fl, opt, &junk, &junk); if (retv) goto done; update: @@ -840,7 +832,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt, len = min_t(unsigned int, len, ipv6_optlen(hdr)); if (copy_to_user(optval, hdr, len)) return -EFAULT; - return len; + return ipv6_optlen(hdr); } static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, @@ -983,9 +975,6 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, len = ipv6_getsockopt_sticky(sk, np->opt, optname, optval, len); release_sock(sk); - /* check if ipv6_getsockopt_sticky() returns err code */ - if (len < 0) - return len; return put_user(len, optlen); } diff --git a/trunk/net/ipv6/netfilter/nf_conntrack_reasm.c b/trunk/net/ipv6/netfilter/nf_conntrack_reasm.c index e65e26e210ee..2dccad48058c 100644 --- a/trunk/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/trunk/net/ipv6/netfilter/nf_conntrack_reasm.c @@ -209,9 +209,7 @@ fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst) arg.dst = dst; hash = ip6qhashfn(id, src, dst); - local_bh_disable(); q = inet_frag_find(&nf_init_frags, &nf_frags, &arg, hash); - local_bh_enable(); if (q == NULL) goto oom; @@ -640,10 +638,10 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb) goto ret_orig; } - spin_lock_bh(&fq->q.lock); + spin_lock(&fq->q.lock); if (nf_ct_frag6_queue(fq, clone, fhdr, nhoff) < 0) { - spin_unlock_bh(&fq->q.lock); + spin_unlock(&fq->q.lock); pr_debug("Can't insert skb to queue\n"); fq_put(fq); goto ret_orig; @@ -655,7 +653,7 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb) if (ret_skb == NULL) pr_debug("Can't reassemble fragmented packets\n"); } - spin_unlock_bh(&fq->q.lock); + spin_unlock(&fq->q.lock); fq_put(fq); return ret_skb; diff --git a/trunk/net/ipv6/raw.c b/trunk/net/ipv6/raw.c index 603df76e0522..232e0dc45bf5 100644 --- a/trunk/net/ipv6/raw.c +++ b/trunk/net/ipv6/raw.c @@ -813,7 +813,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, memset(opt, 0, sizeof(struct ipv6_txoptions)); opt->tot_len = sizeof(struct ipv6_txoptions); - err = datagram_send_ctl(sock_net(sk), msg, &fl, opt, &hlimit, &tclass); + err = datagram_send_ctl(msg, &fl, opt, &hlimit, &tclass); if (err < 0) { fl6_sock_release(flowlabel); return err; diff --git a/trunk/net/ipv6/route.c b/trunk/net/ipv6/route.c index 220cffe9e63b..48534c6c0735 100644 --- a/trunk/net/ipv6/route.c +++ b/trunk/net/ipv6/route.c @@ -446,7 +446,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, struct route_info *rinfo = (struct route_info *) opt; struct in6_addr prefix_buf, *prefix; unsigned int pref; - unsigned long lifetime; + u32 lifetime; struct rt6_info *rt; if (len < sizeof(struct route_info)) { @@ -472,7 +472,13 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, if (pref == ICMPV6_ROUTER_PREF_INVALID) pref = ICMPV6_ROUTER_PREF_MEDIUM; - lifetime = addrconf_timeout_fixup(ntohl(rinfo->lifetime), HZ); + lifetime = ntohl(rinfo->lifetime); + if (lifetime == 0xffffffff) { + /* infinity */ + } else if (lifetime > 0x7fffffff/HZ - 1) { + /* Avoid arithmetic overflow */ + lifetime = 0x7fffffff/HZ - 1; + } if (rinfo->length == 3) prefix = (struct in6_addr *)rinfo->prefix; @@ -500,7 +506,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, (rt->rt6i_flags & ~RTF_PREF_MASK) | RTF_PREF(pref); if (rt) { - if (!addrconf_finite_timeout(lifetime)) { + if (lifetime == 0xffffffff) { rt->rt6i_flags &= ~RTF_EXPIRES; } else { rt->rt6i_expires = jiffies + HZ * lifetime; diff --git a/trunk/net/ipv6/tunnel6.c b/trunk/net/ipv6/tunnel6.c index 669f280989c3..6323921b40be 100644 --- a/trunk/net/ipv6/tunnel6.c +++ b/trunk/net/ipv6/tunnel6.c @@ -109,7 +109,7 @@ static int tunnel46_rcv(struct sk_buff *skb) { struct xfrm6_tunnel *handler; - if (!pskb_may_pull(skb, sizeof(struct iphdr))) + if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) goto drop; for (handler = tunnel46_handlers; handler; handler = handler->next) diff --git a/trunk/net/ipv6/udp.c b/trunk/net/ipv6/udp.c index dd309626ae9a..1fd784f3e2ec 100644 --- a/trunk/net/ipv6/udp.c +++ b/trunk/net/ipv6/udp.c @@ -534,9 +534,7 @@ static void udp_v6_flush_pending_frames(struct sock *sk) { struct udp_sock *up = udp_sk(sk); - if (up->pending == AF_INET) - udp_flush_pending_frames(sk); - else if (up->pending) { + if (up->pending) { up->len = 0; up->pending = 0; ip6_flush_pending_frames(sk); @@ -733,7 +731,7 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, memset(opt, 0, sizeof(struct ipv6_txoptions)); opt->tot_len = sizeof(*opt); - err = datagram_send_ctl(sock_net(sk), msg, &fl, opt, &hlimit, &tclass); + err = datagram_send_ctl(msg, &fl, opt, &hlimit, &tclass); if (err < 0) { fl6_sock_release(flowlabel); return err; @@ -850,14 +848,12 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, } else { dst_release(dst); } - dst = NULL; } if (err > 0) err = np->recverr ? net_xmit_errno(err) : 0; release_sock(sk); out: - dst_release(dst); fl6_sock_release(flowlabel); if (!err) return len; diff --git a/trunk/net/irda/af_irda.c b/trunk/net/irda/af_irda.c index 3eb5bcc75f99..ae54b20d0470 100644 --- a/trunk/net/irda/af_irda.c +++ b/trunk/net/irda/af_irda.c @@ -1093,6 +1093,11 @@ static int irda_create(struct net *net, struct socket *sock, int protocol) init_waitqueue_head(&self->query_wait); + /* Initialise networking socket struct */ + sock_init_data(sock, sk); /* Note : set sk->sk_refcnt to 1 */ + sk->sk_family = PF_IRDA; + sk->sk_protocol = protocol; + switch (sock->type) { case SOCK_STREAM: sock->ops = &irda_stream_ops; @@ -1119,20 +1124,13 @@ static int irda_create(struct net *net, struct socket *sock, int protocol) self->max_sdu_size_rx = TTP_SAR_UNBOUND; break; default: - sk_free(sk); return -ESOCKTNOSUPPORT; } break; default: - sk_free(sk); return -ESOCKTNOSUPPORT; } - /* Initialise networking socket struct */ - sock_init_data(sock, sk); /* Note : set sk->sk_refcnt to 1 */ - sk->sk_family = PF_IRDA; - sk->sk_protocol = protocol; - /* Register as a client with IrLMP */ self->ckey = irlmp_register_client(0, NULL, NULL, NULL); self->mask.word = 0xffff; diff --git a/trunk/net/netfilter/xt_connlimit.c b/trunk/net/netfilter/xt_connlimit.c index 70907f6baac3..2e89a00df92c 100644 --- a/trunk/net/netfilter/xt_connlimit.c +++ b/trunk/net/netfilter/xt_connlimit.c @@ -73,8 +73,7 @@ connlimit_iphash6(const union nf_inet_addr *addr, static inline bool already_closed(const struct nf_conn *conn) { if (nf_ct_protonum(conn) == IPPROTO_TCP) - return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT || - conn->proto.tcp.state == TCP_CONNTRACK_CLOSE; + return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT; else return 0; } diff --git a/trunk/net/netlink/attr.c b/trunk/net/netlink/attr.c index 47bbf45ae5d7..feb326f4a752 100644 --- a/trunk/net/netlink/attr.c +++ b/trunk/net/netlink/attr.c @@ -400,13 +400,13 @@ void __nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data) * @attrlen: length of attribute payload * @data: head of attribute payload * - * Returns -EMSGSIZE if the tailroom of the skb is insufficient to store + * Returns -1 if the tailroom of the skb is insufficient to store * the attribute header and payload. */ int nla_put(struct sk_buff *skb, int attrtype, int attrlen, const void *data) { if (unlikely(skb_tailroom(skb) < nla_total_size(attrlen))) - return -EMSGSIZE; + return -1; __nla_put(skb, attrtype, attrlen, data); return 0; @@ -418,13 +418,13 @@ int nla_put(struct sk_buff *skb, int attrtype, int attrlen, const void *data) * @attrlen: length of attribute payload * @data: head of attribute payload * - * Returns -EMSGSIZE if the tailroom of the skb is insufficient to store + * Returns -1 if the tailroom of the skb is insufficient to store * the attribute payload. */ int nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data) { if (unlikely(skb_tailroom(skb) < NLA_ALIGN(attrlen))) - return -EMSGSIZE; + return -1; __nla_put_nohdr(skb, attrlen, data); return 0; @@ -436,13 +436,13 @@ int nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data) * @attrlen: length of attribute payload * @data: head of attribute payload * - * Returns -EMSGSIZE if the tailroom of the skb is insufficient to store + * Returns -1 if the tailroom of the skb is insufficient to store * the attribute payload. */ int nla_append(struct sk_buff *skb, int attrlen, const void *data) { if (unlikely(skb_tailroom(skb) < NLA_ALIGN(attrlen))) - return -EMSGSIZE; + return -1; memcpy(skb_put(skb, attrlen), data, attrlen); return 0; diff --git a/trunk/net/netlink/genetlink.c b/trunk/net/netlink/genetlink.c index f5aa23c3e886..d16929c9b4bc 100644 --- a/trunk/net/netlink/genetlink.c +++ b/trunk/net/netlink/genetlink.c @@ -554,8 +554,7 @@ static int ctrl_fill_info(struct genl_family *family, u32 pid, u32 seq, return genlmsg_end(skb, hdr); nla_put_failure: - genlmsg_cancel(skb, hdr); - return -EMSGSIZE; + return genlmsg_cancel(skb, hdr); } static int ctrl_fill_mcgrp_info(struct genl_multicast_group *grp, u32 pid, @@ -591,8 +590,7 @@ static int ctrl_fill_mcgrp_info(struct genl_multicast_group *grp, u32 pid, return genlmsg_end(skb, hdr); nla_put_failure: - genlmsg_cancel(skb, hdr); - return -EMSGSIZE; + return genlmsg_cancel(skb, hdr); } static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb) diff --git a/trunk/net/sched/sch_dsmark.c b/trunk/net/sched/sch_dsmark.c index 64465bacbe79..0df911fd67b1 100644 --- a/trunk/net/sched/sch_dsmark.c +++ b/trunk/net/sched/sch_dsmark.c @@ -444,8 +444,7 @@ static int dsmark_dump_class(struct Qdisc *sch, unsigned long cl, return nla_nest_end(skb, opts); nla_put_failure: - nla_nest_cancel(skb, opts); - return -EMSGSIZE; + return nla_nest_cancel(skb, opts); } static int dsmark_dump(struct Qdisc *sch, struct sk_buff *skb) @@ -467,8 +466,7 @@ static int dsmark_dump(struct Qdisc *sch, struct sk_buff *skb) return nla_nest_end(skb, opts); nla_put_failure: - nla_nest_cancel(skb, opts); - return -EMSGSIZE; + return nla_nest_cancel(skb, opts); } static const struct Qdisc_class_ops dsmark_class_ops = { diff --git a/trunk/net/sched/sch_gred.c b/trunk/net/sched/sch_gred.c index c89fba56db56..3a9d226ff1e4 100644 --- a/trunk/net/sched/sch_gred.c +++ b/trunk/net/sched/sch_gred.c @@ -582,8 +582,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb) return nla_nest_end(skb, opts); nla_put_failure: - nla_nest_cancel(skb, opts); - return -EMSGSIZE; + return nla_nest_cancel(skb, opts); } static void gred_destroy(struct Qdisc *sch) diff --git a/trunk/net/sched/sch_hfsc.c b/trunk/net/sched/sch_hfsc.c index fdfaa3fcc16d..87293d0db1d7 100644 --- a/trunk/net/sched/sch_hfsc.c +++ b/trunk/net/sched/sch_hfsc.c @@ -1360,7 +1360,7 @@ hfsc_dump_class(struct Qdisc *sch, unsigned long arg, struct sk_buff *skb, nla_put_failure: nla_nest_cancel(skb, nest); - return -EMSGSIZE; + return -1; } static int diff --git a/trunk/net/sched/sch_red.c b/trunk/net/sched/sch_red.c index 5c569853b9c0..3dcd493f4f4a 100644 --- a/trunk/net/sched/sch_red.c +++ b/trunk/net/sched/sch_red.c @@ -281,8 +281,7 @@ static int red_dump(struct Qdisc *sch, struct sk_buff *skb) return nla_nest_end(skb, opts); nla_put_failure: - nla_nest_cancel(skb, opts); - return -EMSGSIZE; + return nla_nest_cancel(skb, opts); } static int red_dump_stats(struct Qdisc *sch, struct gnet_dump *d) diff --git a/trunk/net/sctp/associola.c b/trunk/net/sctp/associola.c index 532634861db1..b4cd2b71953f 100644 --- a/trunk/net/sctp/associola.c +++ b/trunk/net/sctp/associola.c @@ -1203,9 +1203,6 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc) struct list_head *head = &asoc->peer.transport_addr_list; struct list_head *pos; - if (asoc->peer.transport_count == 1) - return; - /* Find the next transport in a round-robin fashion. */ t = asoc->peer.retran_path; pos = &t->transports; @@ -1220,15 +1217,6 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc) t = list_entry(pos, struct sctp_transport, transports); - /* We have exhausted the list, but didn't find any - * other active transports. If so, use the next - * transport. - */ - if (t == asoc->peer.retran_path) { - t = next; - break; - } - /* Try to find an active transport. */ if ((t->state == SCTP_ACTIVE) || @@ -1241,6 +1229,15 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc) if (!next) next = t; } + + /* We have exhausted the list, but didn't find any + * other active transports. If so, use the next + * transport. + */ + if (t == asoc->peer.retran_path) { + t = next; + break; + } } asoc->peer.retran_path = t; diff --git a/trunk/net/sctp/ipv6.c b/trunk/net/sctp/ipv6.c index a2f4d4d51593..e45e44c60635 100644 --- a/trunk/net/sctp/ipv6.c +++ b/trunk/net/sctp/ipv6.c @@ -299,8 +299,7 @@ static inline int sctp_v6_addr_match_len(union sctp_addr *s1, /* Fills in the source address(saddr) based on the destination address(daddr) * and asoc's bind address list. */ -static void sctp_v6_get_saddr(struct sctp_sock *sk, - struct sctp_association *asoc, +static void sctp_v6_get_saddr(struct sctp_association *asoc, struct dst_entry *dst, union sctp_addr *daddr, union sctp_addr *saddr) @@ -319,7 +318,7 @@ static void sctp_v6_get_saddr(struct sctp_sock *sk, if (!asoc) { ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL, &daddr->v6.sin6_addr, - inet6_sk(&sk->inet.sk)->srcprefs, + inet6_sk(asoc->base.sk)->srcprefs, &saddr->v6.sin6_addr); SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n", NIP6(saddr->v6.sin6_addr)); @@ -727,11 +726,6 @@ static void sctp_v6_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr) seq_printf(seq, NIP6_FMT " ", NIP6(addr->v6.sin6_addr)); } -static void sctp_v6_ecn_capable(struct sock *sk) -{ - inet6_sk(sk)->tclass |= INET_ECN_ECT_0; -} - /* Initialize a PF_INET6 socket msg_name. */ static void sctp_inet6_msgname(char *msgname, int *addr_len) { @@ -1002,7 +996,6 @@ static struct sctp_af sctp_af_inet6 = { .skb_iif = sctp_v6_skb_iif, .is_ce = sctp_v6_is_ce, .seq_dump_addr = sctp_v6_seq_dump_addr, - .ecn_capable = sctp_v6_ecn_capable, .net_header_len = sizeof(struct ipv6hdr), .sockaddr_len = sizeof(struct sockaddr_in6), #ifdef CONFIG_COMPAT diff --git a/trunk/net/sctp/output.c b/trunk/net/sctp/output.c index 6d45bae93b46..cf4f9fb6819d 100644 --- a/trunk/net/sctp/output.c +++ b/trunk/net/sctp/output.c @@ -548,7 +548,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) * Note: The works for IPv6 layer checks this bit too later * in transmission. See IP6_ECN_flow_xmit(). */ - (*tp->af_specific->ecn_capable)(nskb->sk); + INET_ECN_xmit(nskb->sk); /* Set up the IP options. */ /* BUG: not implemented diff --git a/trunk/net/sctp/outqueue.c b/trunk/net/sctp/outqueue.c index ace6770e9048..59edfd25a19c 100644 --- a/trunk/net/sctp/outqueue.c +++ b/trunk/net/sctp/outqueue.c @@ -208,7 +208,6 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q) INIT_LIST_HEAD(&q->sacked); INIT_LIST_HEAD(&q->abandoned); - q->fast_rtx = 0; q->outstanding_bytes = 0; q->empty = 1; q->cork = 0; @@ -501,7 +500,6 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport, case SCTP_RTXR_FAST_RTX: SCTP_INC_STATS(SCTP_MIB_FAST_RETRANSMITS); sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_FAST_RTX); - q->fast_rtx = 1; break; case SCTP_RTXR_PMTUD: SCTP_INC_STATS(SCTP_MIB_PMTUD_RETRANSMITS); @@ -520,15 +518,9 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport, * the sender SHOULD try to advance the "Advanced.Peer.Ack.Point" by * following the procedures outlined in C1 - C5. */ - if (reason == SCTP_RTXR_T3_RTX) - sctp_generate_fwdtsn(q, q->asoc->ctsn_ack_point); + sctp_generate_fwdtsn(q, q->asoc->ctsn_ack_point); - /* Flush the queues only on timeout, since fast_rtx is only - * triggered during sack processing and the queue - * will be flushed at the end. - */ - if (reason != SCTP_RTXR_FAST_RTX) - error = sctp_outq_flush(q, /* rtx_timeout */ 1); + error = sctp_outq_flush(q, /* rtx_timeout */ 1); if (error) q->asoc->base.sk->sk_err = -error; @@ -546,23 +538,17 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, int rtx_timeout, int *start_timer) { struct list_head *lqueue; + struct list_head *lchunk; struct sctp_transport *transport = pkt->transport; sctp_xmit_t status; struct sctp_chunk *chunk, *chunk1; struct sctp_association *asoc; - int fast_rtx; int error = 0; - int timer = 0; - int done = 0; asoc = q->asoc; lqueue = &q->retransmit; - fast_rtx = q->fast_rtx; - /* This loop handles time-out retransmissions, fast retransmissions, - * and retransmissions due to opening of whindow. - * - * RFC 2960 6.3.3 Handle T3-rtx Expiration + /* RFC 2960 6.3.3 Handle T3-rtx Expiration * * E3) Determine how many of the earliest (i.e., lowest TSN) * outstanding DATA chunks for the address for which the @@ -577,12 +563,12 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, * [Just to be painfully clear, if we are retransmitting * because a timeout just happened, we should send only ONE * packet of retransmitted data.] - * - * For fast retransmissions we also send only ONE packet. However, - * if we are just flushing the queue due to open window, we'll - * try to send as much as possible. */ - list_for_each_entry_safe(chunk, chunk1, lqueue, transmitted_list) { + lchunk = sctp_list_dequeue(lqueue); + + while (lchunk) { + chunk = list_entry(lchunk, struct sctp_chunk, + transmitted_list); /* Make sure that Gap Acked TSNs are not retransmitted. A * simple approach is just to move such TSNs out of the @@ -590,60 +576,58 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, * next chunk. */ if (chunk->tsn_gap_acked) { - list_del(&chunk->transmitted_list); - list_add_tail(&chunk->transmitted_list, - &transport->transmitted); + list_add_tail(lchunk, &transport->transmitted); + lchunk = sctp_list_dequeue(lqueue); continue; } - /* If we are doing fast retransmit, ignore non-fast_rtransmit - * chunks - */ - if (fast_rtx && !chunk->fast_retransmit) - continue; - /* Attempt to append this chunk to the packet. */ status = sctp_packet_append_chunk(pkt, chunk); switch (status) { case SCTP_XMIT_PMTU_FULL: /* Send this packet. */ - error = sctp_packet_transmit(pkt); + if ((error = sctp_packet_transmit(pkt)) == 0) + *start_timer = 1; /* If we are retransmitting, we should only * send a single packet. */ - if (rtx_timeout || fast_rtx) - done = 1; + if (rtx_timeout) { + list_add(lchunk, lqueue); + lchunk = NULL; + } - /* Bundle next chunk in the next round. */ + /* Bundle lchunk in the next round. */ break; case SCTP_XMIT_RWND_FULL: /* Send this packet. */ - error = sctp_packet_transmit(pkt); + if ((error = sctp_packet_transmit(pkt)) == 0) + *start_timer = 1; /* Stop sending DATA as there is no more room * at the receiver. */ - done = 1; + list_add(lchunk, lqueue); + lchunk = NULL; break; case SCTP_XMIT_NAGLE_DELAY: /* Send this packet. */ - error = sctp_packet_transmit(pkt); + if ((error = sctp_packet_transmit(pkt)) == 0) + *start_timer = 1; /* Stop sending DATA because of nagle delay. */ - done = 1; + list_add(lchunk, lqueue); + lchunk = NULL; break; default: /* The append was successful, so add this chunk to * the transmitted list. */ - list_del(&chunk->transmitted_list); - list_add_tail(&chunk->transmitted_list, - &transport->transmitted); + list_add_tail(lchunk, &transport->transmitted); /* Mark the chunk as ineligible for fast retransmit * after it is retransmitted. @@ -651,44 +635,27 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, if (chunk->fast_retransmit > 0) chunk->fast_retransmit = -1; - /* Force start T3-rtx timer when fast retransmitting - * the earliest outstanding TSN - */ - if (!timer && fast_rtx && - ntohl(chunk->subh.data_hdr->tsn) == - asoc->ctsn_ack_point + 1) - timer = 2; - + *start_timer = 1; q->empty = 0; - break; - } - - /* Set the timer if there were no errors */ - if (!error && !timer) - timer = 1; - if (done) + /* Retrieve a new chunk to bundle. */ + lchunk = sctp_list_dequeue(lqueue); break; - } + } - /* If we are here due to a retransmit timeout or a fast - * retransmit and if there are any chunks left in the retransmit - * queue that could not fit in the PMTU sized packet, they need - * to be marked as ineligible for a subsequent fast retransmit. - */ - if (rtx_timeout || fast_rtx) { - list_for_each_entry(chunk1, lqueue, transmitted_list) { - if (chunk1->fast_retransmit > 0) - chunk1->fast_retransmit = -1; + /* If we are here due to a retransmit timeout or a fast + * retransmit and if there are any chunks left in the retransmit + * queue that could not fit in the PMTU sized packet, they need + * to be marked as ineligible for a subsequent fast retransmit. + */ + if (rtx_timeout && !lchunk) { + list_for_each_entry(chunk1, lqueue, transmitted_list) { + if (chunk1->fast_retransmit > 0) + chunk1->fast_retransmit = -1; + } } } - *start_timer = timer; - - /* Clear fast retransmit hint */ - if (fast_rtx) - q->fast_rtx = 0; - return error; } @@ -895,8 +862,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) rtx_timeout, &start_timer); if (start_timer) - sctp_transport_reset_timers(transport, - start_timer-1); + sctp_transport_reset_timers(transport); /* This can happen on COOKIE-ECHO resend. Only * one chunk can get bundled with a COOKIE-ECHO. @@ -1011,7 +977,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) list_add_tail(&chunk->transmitted_list, &transport->transmitted); - sctp_transport_reset_timers(transport, start_timer-1); + sctp_transport_reset_timers(transport); q->empty = 0; diff --git a/trunk/net/sctp/protocol.c b/trunk/net/sctp/protocol.c index b435a193c5df..0ec234b762c2 100644 --- a/trunk/net/sctp/protocol.c +++ b/trunk/net/sctp/protocol.c @@ -470,11 +470,11 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, /* Walk through the bind address list and look for a bind * address that matches the source address of the returned dst. */ - sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port)); rcu_read_lock(); list_for_each_entry_rcu(laddr, &bp->address_list, list) { if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC)) continue; + sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port)); if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) goto out_unlock; } @@ -519,8 +519,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, /* For v4, the source address is cached in the route entry(dst). So no need * to cache it separately and hence this is an empty routine. */ -static void sctp_v4_get_saddr(struct sctp_sock *sk, - struct sctp_association *asoc, +static void sctp_v4_get_saddr(struct sctp_association *asoc, struct dst_entry *dst, union sctp_addr *daddr, union sctp_addr *saddr) @@ -617,11 +616,6 @@ static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr) seq_printf(seq, "%d.%d.%d.%d ", NIPQUAD(addr->v4.sin_addr)); } -static void sctp_v4_ecn_capable(struct sock *sk) -{ - INET_ECN_xmit(sk); -} - /* Event handler for inet address addition/deletion events. * The sctp_local_addr_list needs to be protocted by a spin lock since * multiple notifiers (say IPv4 and IPv6) may be running at the same @@ -940,7 +934,6 @@ static struct sctp_af sctp_af_inet = { .skb_iif = sctp_v4_skb_iif, .is_ce = sctp_v4_is_ce, .seq_dump_addr = sctp_v4_seq_dump_addr, - .ecn_capable = sctp_v4_ecn_capable, .net_header_len = sizeof(struct iphdr), .sockaddr_len = sizeof(struct sockaddr_in), #ifdef CONFIG_COMPAT diff --git a/trunk/net/sctp/transport.c b/trunk/net/sctp/transport.c index 3f34f61221ec..f4938f6c5abe 100644 --- a/trunk/net/sctp/transport.c +++ b/trunk/net/sctp/transport.c @@ -79,7 +79,6 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer, peer->rttvar = 0; peer->srtt = 0; peer->rto_pending = 0; - peer->fast_recovery = 0; peer->last_time_heard = jiffies; peer->last_time_used = jiffies; @@ -191,7 +190,7 @@ static void sctp_transport_destroy(struct sctp_transport *transport) /* Start T3_rtx timer if it is not already running and update the heartbeat * timer. This routine is called every time a DATA chunk is sent. */ -void sctp_transport_reset_timers(struct sctp_transport *transport, int force) +void sctp_transport_reset_timers(struct sctp_transport *transport) { /* RFC 2960 6.3.2 Retransmission Timer Rules * @@ -201,7 +200,7 @@ void sctp_transport_reset_timers(struct sctp_transport *transport, int force) * address. */ - if (force || !timer_pending(&transport->T3_rtx_timer)) + if (!timer_pending(&transport->T3_rtx_timer)) if (!mod_timer(&transport->T3_rtx_timer, jiffies + transport->rto)) sctp_transport_hold(transport); @@ -292,7 +291,7 @@ void sctp_transport_route(struct sctp_transport *transport, if (saddr) memcpy(&transport->saddr, saddr, sizeof(union sctp_addr)); else - af->get_saddr(opt, asoc, dst, daddr, &transport->saddr); + af->get_saddr(asoc, dst, daddr, &transport->saddr); transport->dst = dst; if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) { @@ -404,16 +403,11 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport, cwnd = transport->cwnd; flight_size = transport->flight_size; - /* See if we need to exit Fast Recovery first */ - if (transport->fast_recovery && - TSN_lte(transport->fast_recovery_exit, sack_ctsn)) - transport->fast_recovery = 0; - /* The appropriate cwnd increase algorithm is performed if, and only - * if the cumulative TSN whould advanced and the congestion window is + * if the cumulative TSN has advanced and the congestion window is * being fully utilized. */ - if (TSN_lte(sack_ctsn, transport->asoc->ctsn_ack_point) || + if ((transport->asoc->ctsn_ack_point >= sack_ctsn) || (flight_size < cwnd)) return; @@ -422,23 +416,17 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport, pmtu = transport->asoc->pathmtu; if (cwnd <= ssthresh) { - /* RFC 4960 7.2.1 - * o When cwnd is less than or equal to ssthresh, an SCTP - * endpoint MUST use the slow-start algorithm to increase - * cwnd only if the current congestion window is being fully - * utilized, an incoming SACK advances the Cumulative TSN - * Ack Point, and the data sender is not in Fast Recovery. - * Only when these three conditions are met can the cwnd be - * increased; otherwise, the cwnd MUST not be increased. - * If these conditions are met, then cwnd MUST be increased - * by, at most, the lesser of 1) the total size of the - * previously outstanding DATA chunk(s) acknowledged, and - * 2) the destination's path MTU. This upper bound protects - * against the ACK-Splitting attack outlined in [SAVAGE99]. + /* RFC 2960 7.2.1, sctpimpguide-05 2.14.2 When cwnd is less + * than or equal to ssthresh an SCTP endpoint MUST use the + * slow start algorithm to increase cwnd only if the current + * congestion window is being fully utilized and an incoming + * SACK advances the Cumulative TSN Ack Point. Only when these + * two conditions are met can the cwnd be increased otherwise + * the cwnd MUST not be increased. If these conditions are met + * then cwnd MUST be increased by at most the lesser of + * 1) the total size of the previously outstanding DATA + * chunk(s) acknowledged, and 2) the destination's path MTU. */ - if (transport->fast_recovery) - return; - if (bytes_acked > pmtu) cwnd += pmtu; else @@ -514,13 +502,6 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, * cwnd = ssthresh * partial_bytes_acked = 0 */ - if (transport->fast_recovery) - return; - - /* Mark Fast recovery */ - transport->fast_recovery = 1; - transport->fast_recovery_exit = transport->asoc->next_tsn - 1; - transport->ssthresh = max(transport->cwnd/2, 4*transport->asoc->pathmtu); transport->cwnd = transport->ssthresh; @@ -605,7 +586,6 @@ void sctp_transport_reset(struct sctp_transport *t) t->flight_size = 0; t->error_count = 0; t->rto_pending = 0; - t->fast_recovery = 0; /* Initialize the state information for SFR-CACC */ t->cacc.changeover_active = 0; diff --git a/trunk/net/wireless/nl80211.c b/trunk/net/wireless/nl80211.c index fb75f265b39c..2bdd4dddc0e1 100644 --- a/trunk/net/wireless/nl80211.c +++ b/trunk/net/wireless/nl80211.c @@ -187,8 +187,7 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, return genlmsg_end(msg, hdr); nla_put_failure: - genlmsg_cancel(msg, hdr); - return -EMSGSIZE; + return genlmsg_cancel(msg, hdr); } static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) @@ -274,8 +273,7 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags, return genlmsg_end(msg, hdr); nla_put_failure: - genlmsg_cancel(msg, hdr); - return -EMSGSIZE; + return genlmsg_cancel(msg, hdr); } static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback *cb) @@ -930,8 +928,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, return genlmsg_end(msg, hdr); nla_put_failure: - genlmsg_cancel(msg, hdr); - return -EMSGSIZE; + return genlmsg_cancel(msg, hdr); } static int nl80211_dump_station(struct sk_buff *skb, @@ -1270,8 +1267,7 @@ static int nl80211_send_mpath(struct sk_buff *msg, u32 pid, u32 seq, return genlmsg_end(msg, hdr); nla_put_failure: - genlmsg_cancel(msg, hdr); - return -EMSGSIZE; + return genlmsg_cancel(msg, hdr); } static int nl80211_dump_mpath(struct sk_buff *skb, diff --git a/trunk/net/xfrm/xfrm_algo.c b/trunk/net/xfrm/xfrm_algo.c index 23a2cc04b8cd..ac765dd9c7f5 100644 --- a/trunk/net/xfrm/xfrm_algo.c +++ b/trunk/net/xfrm/xfrm_algo.c @@ -200,8 +200,8 @@ static struct xfrm_algo_desc aalg_list[] = { } }, { - .name = "hmac(rmd160)", - .compat = "rmd160", + .name = "hmac(ripemd160)", + .compat = "ripemd160", .uinfo = { .auth = {