diff options
| author | David S. Miller <davem@davemloft.net> | 2011-02-08 20:19:01 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2011-02-08 20:19:01 -0500 |
| commit | 263fb5b1bf9265d0e4ce59ff6ea92f478b5b61ea (patch) | |
| tree | 5ee497d530185d32421122729af86cf77d0dc649 /net | |
| parent | 8d13a2a9fb3e5e3f68e9d3ec0de3c8fcfa56a224 (diff) | |
| parent | c69b90920a36b88ab0d649963d81355d865eeb05 (diff) | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/e1000e/netdev.c
Diffstat (limited to 'net')
| -rw-r--r-- | net/batman-adv/unicast.c | 15 | ||||
| -rw-r--r-- | net/caif/chnl_net.c | 4 | ||||
| -rw-r--r-- | net/core/dev.c | 27 | ||||
| -rw-r--r-- | net/mac80211/cfg.c | 2 | ||||
| -rw-r--r-- | net/mac80211/ieee80211_i.h | 2 | ||||
| -rw-r--r-- | net/mac80211/status.c | 7 | ||||
| -rw-r--r-- | net/mac80211/tx.c | 2 | ||||
| -rw-r--r-- | net/x25/x25_facilities.c | 28 | ||||
| -rw-r--r-- | net/x25/x25_in.c | 14 |
9 files changed, 68 insertions, 33 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index cbf022cb3121..bedf29425775 100644 --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c | |||
| @@ -50,12 +50,12 @@ static struct sk_buff *frag_merge_packet(struct list_head *head, | |||
| 50 | skb = tfp->skb; | 50 | skb = tfp->skb; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | if (skb_linearize(skb) < 0 || skb_linearize(tmp_skb) < 0) | ||
| 54 | goto err; | ||
| 55 | |||
| 53 | skb_pull(tmp_skb, sizeof(struct unicast_frag_packet)); | 56 | skb_pull(tmp_skb, sizeof(struct unicast_frag_packet)); |
| 54 | if (pskb_expand_head(skb, 0, tmp_skb->len, GFP_ATOMIC) < 0) { | 57 | if (pskb_expand_head(skb, 0, tmp_skb->len, GFP_ATOMIC) < 0) |
| 55 | /* free buffered skb, skb will be freed later */ | 58 | goto err; |
| 56 | kfree_skb(tfp->skb); | ||
| 57 | return NULL; | ||
| 58 | } | ||
| 59 | 59 | ||
| 60 | /* move free entry to end */ | 60 | /* move free entry to end */ |
| 61 | tfp->skb = NULL; | 61 | tfp->skb = NULL; |
| @@ -70,6 +70,11 @@ static struct sk_buff *frag_merge_packet(struct list_head *head, | |||
| 70 | unicast_packet->packet_type = BAT_UNICAST; | 70 | unicast_packet->packet_type = BAT_UNICAST; |
| 71 | 71 | ||
| 72 | return skb; | 72 | return skb; |
| 73 | |||
| 74 | err: | ||
| 75 | /* free buffered skb, skb will be freed later */ | ||
| 76 | kfree_skb(tfp->skb); | ||
| 77 | return NULL; | ||
| 73 | } | 78 | } |
| 74 | 79 | ||
| 75 | static void frag_create_entry(struct list_head *head, struct sk_buff *skb) | 80 | static void frag_create_entry(struct list_head *head, struct sk_buff *skb) |
diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c index fa9dab372b68..6008d6dc18a0 100644 --- a/net/caif/chnl_net.c +++ b/net/caif/chnl_net.c | |||
| @@ -394,9 +394,7 @@ static void ipcaif_net_setup(struct net_device *dev) | |||
| 394 | priv->conn_req.sockaddr.u.dgm.connection_id = -1; | 394 | priv->conn_req.sockaddr.u.dgm.connection_id = -1; |
| 395 | priv->flowenabled = false; | 395 | priv->flowenabled = false; |
| 396 | 396 | ||
| 397 | ASSERT_RTNL(); | ||
| 398 | init_waitqueue_head(&priv->netmgmt_wq); | 397 | init_waitqueue_head(&priv->netmgmt_wq); |
| 399 | list_add(&priv->list_field, &chnl_net_list); | ||
| 400 | } | 398 | } |
| 401 | 399 | ||
| 402 | 400 | ||
| @@ -453,6 +451,8 @@ static int ipcaif_newlink(struct net *src_net, struct net_device *dev, | |||
| 453 | ret = register_netdevice(dev); | 451 | ret = register_netdevice(dev); |
| 454 | if (ret) | 452 | if (ret) |
| 455 | pr_warn("device rtml registration failed\n"); | 453 | pr_warn("device rtml registration failed\n"); |
| 454 | else | ||
| 455 | list_add(&caifdev->list_field, &chnl_net_list); | ||
| 456 | return ret; | 456 | return ret; |
| 457 | } | 457 | } |
| 458 | 458 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index f46ee357ff2e..6392ea0a5910 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -5807,31 +5807,36 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, | |||
| 5807 | 5807 | ||
| 5808 | dev_net_set(dev, &init_net); | 5808 | dev_net_set(dev, &init_net); |
| 5809 | 5809 | ||
| 5810 | dev->gso_max_size = GSO_MAX_SIZE; | ||
| 5811 | |||
| 5812 | INIT_LIST_HEAD(&dev->ethtool_ntuple_list.list); | ||
| 5813 | dev->ethtool_ntuple_list.count = 0; | ||
| 5814 | INIT_LIST_HEAD(&dev->napi_list); | ||
| 5815 | INIT_LIST_HEAD(&dev->unreg_list); | ||
| 5816 | INIT_LIST_HEAD(&dev->link_watch_list); | ||
| 5817 | dev->priv_flags = IFF_XMIT_DST_RELEASE; | ||
| 5818 | setup(dev); | ||
| 5819 | |||
| 5810 | dev->num_tx_queues = txqs; | 5820 | dev->num_tx_queues = txqs; |
| 5811 | dev->real_num_tx_queues = txqs; | 5821 | dev->real_num_tx_queues = txqs; |
| 5812 | if (netif_alloc_netdev_queues(dev)) | 5822 | if (netif_alloc_netdev_queues(dev)) |
| 5813 | goto free_pcpu; | 5823 | goto free_all; |
| 5814 | 5824 | ||
| 5815 | #ifdef CONFIG_RPS | 5825 | #ifdef CONFIG_RPS |
| 5816 | dev->num_rx_queues = rxqs; | 5826 | dev->num_rx_queues = rxqs; |
| 5817 | dev->real_num_rx_queues = rxqs; | 5827 | dev->real_num_rx_queues = rxqs; |
| 5818 | if (netif_alloc_rx_queues(dev)) | 5828 | if (netif_alloc_rx_queues(dev)) |
| 5819 | goto free_pcpu; | 5829 | goto free_all; |
| 5820 | #endif | 5830 | #endif |
| 5821 | 5831 | ||
| 5822 | dev->gso_max_size = GSO_MAX_SIZE; | ||
| 5823 | |||
| 5824 | INIT_LIST_HEAD(&dev->ethtool_ntuple_list.list); | ||
| 5825 | dev->ethtool_ntuple_list.count = 0; | ||
| 5826 | INIT_LIST_HEAD(&dev->napi_list); | ||
| 5827 | INIT_LIST_HEAD(&dev->unreg_list); | ||
| 5828 | INIT_LIST_HEAD(&dev->link_watch_list); | ||
| 5829 | dev->priv_flags = IFF_XMIT_DST_RELEASE; | ||
| 5830 | setup(dev); | ||
| 5831 | strcpy(dev->name, name); | 5832 | strcpy(dev->name, name); |
| 5832 | dev->group = INIT_NETDEV_GROUP; | 5833 | dev->group = INIT_NETDEV_GROUP; |
| 5833 | return dev; | 5834 | return dev; |
| 5834 | 5835 | ||
| 5836 | free_all: | ||
| 5837 | free_netdev(dev); | ||
| 5838 | return NULL; | ||
| 5839 | |||
| 5835 | free_pcpu: | 5840 | free_pcpu: |
| 5836 | free_percpu(dev->pcpu_refcnt); | 5841 | free_percpu(dev->pcpu_refcnt); |
| 5837 | kfree(dev->_tx); | 5842 | kfree(dev->_tx); |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 845c76d58d25..2ba3af850dda 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
| @@ -1838,6 +1838,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct net_device *dev, | |||
| 1838 | *cookie ^= 2; | 1838 | *cookie ^= 2; |
| 1839 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_TX_OFFCHAN; | 1839 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_TX_OFFCHAN; |
| 1840 | local->hw_roc_skb = skb; | 1840 | local->hw_roc_skb = skb; |
| 1841 | local->hw_roc_skb_for_status = skb; | ||
| 1841 | mutex_unlock(&local->mtx); | 1842 | mutex_unlock(&local->mtx); |
| 1842 | 1843 | ||
| 1843 | return 0; | 1844 | return 0; |
| @@ -1891,6 +1892,7 @@ static int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, | |||
| 1891 | if (ret == 0) { | 1892 | if (ret == 0) { |
| 1892 | kfree_skb(local->hw_roc_skb); | 1893 | kfree_skb(local->hw_roc_skb); |
| 1893 | local->hw_roc_skb = NULL; | 1894 | local->hw_roc_skb = NULL; |
| 1895 | local->hw_roc_skb_for_status = NULL; | ||
| 1894 | } | 1896 | } |
| 1895 | 1897 | ||
| 1896 | mutex_unlock(&local->mtx); | 1898 | mutex_unlock(&local->mtx); |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 44eea1af1553..f2ef15d910a5 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
| @@ -951,7 +951,7 @@ struct ieee80211_local { | |||
| 951 | 951 | ||
| 952 | struct ieee80211_channel *hw_roc_channel; | 952 | struct ieee80211_channel *hw_roc_channel; |
| 953 | struct net_device *hw_roc_dev; | 953 | struct net_device *hw_roc_dev; |
| 954 | struct sk_buff *hw_roc_skb; | 954 | struct sk_buff *hw_roc_skb, *hw_roc_skb_for_status; |
| 955 | struct work_struct hw_roc_start, hw_roc_done; | 955 | struct work_struct hw_roc_start, hw_roc_done; |
| 956 | enum nl80211_channel_type hw_roc_channel_type; | 956 | enum nl80211_channel_type hw_roc_channel_type; |
| 957 | unsigned int hw_roc_duration; | 957 | unsigned int hw_roc_duration; |
diff --git a/net/mac80211/status.c b/net/mac80211/status.c index ffb0de9bc2fa..010a559bd872 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c | |||
| @@ -327,6 +327,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
| 327 | 327 | ||
| 328 | if (info->flags & IEEE80211_TX_INTFL_NL80211_FRAME_TX) { | 328 | if (info->flags & IEEE80211_TX_INTFL_NL80211_FRAME_TX) { |
| 329 | struct ieee80211_work *wk; | 329 | struct ieee80211_work *wk; |
| 330 | u64 cookie = (unsigned long)skb; | ||
| 330 | 331 | ||
| 331 | rcu_read_lock(); | 332 | rcu_read_lock(); |
| 332 | list_for_each_entry_rcu(wk, &local->work_list, list) { | 333 | list_for_each_entry_rcu(wk, &local->work_list, list) { |
| @@ -338,8 +339,12 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
| 338 | break; | 339 | break; |
| 339 | } | 340 | } |
| 340 | rcu_read_unlock(); | 341 | rcu_read_unlock(); |
| 342 | if (local->hw_roc_skb_for_status == skb) { | ||
| 343 | cookie = local->hw_roc_cookie ^ 2; | ||
| 344 | local->hw_roc_skb_for_status = NULL; | ||
| 345 | } | ||
| 341 | cfg80211_mgmt_tx_status( | 346 | cfg80211_mgmt_tx_status( |
| 342 | skb->dev, (unsigned long) skb, skb->data, skb->len, | 347 | skb->dev, cookie, skb->data, skb->len, |
| 343 | !!(info->flags & IEEE80211_TX_STAT_ACK), GFP_ATOMIC); | 348 | !!(info->flags & IEEE80211_TX_STAT_ACK), GFP_ATOMIC); |
| 344 | } | 349 | } |
| 345 | 350 | ||
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 38e593939727..17ef4f4e8602 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
| @@ -1549,7 +1549,7 @@ static int ieee80211_skb_resize(struct ieee80211_local *local, | |||
| 1549 | skb_orphan(skb); | 1549 | skb_orphan(skb); |
| 1550 | } | 1550 | } |
| 1551 | 1551 | ||
| 1552 | if (skb_header_cloned(skb)) | 1552 | if (skb_cloned(skb)) |
| 1553 | I802_DEBUG_INC(local->tx_expand_skb_head_cloned); | 1553 | I802_DEBUG_INC(local->tx_expand_skb_head_cloned); |
| 1554 | else if (head_need || tail_need) | 1554 | else if (head_need || tail_need) |
| 1555 | I802_DEBUG_INC(local->tx_expand_skb_head); | 1555 | I802_DEBUG_INC(local->tx_expand_skb_head); |
diff --git a/net/x25/x25_facilities.c b/net/x25/x25_facilities.c index 55187c8f6420..406207515b5e 100644 --- a/net/x25/x25_facilities.c +++ b/net/x25/x25_facilities.c | |||
| @@ -27,9 +27,19 @@ | |||
| 27 | #include <net/sock.h> | 27 | #include <net/sock.h> |
| 28 | #include <net/x25.h> | 28 | #include <net/x25.h> |
| 29 | 29 | ||
| 30 | /* | 30 | /** |
| 31 | * Parse a set of facilities into the facilities structures. Unrecognised | 31 | * x25_parse_facilities - Parse facilities from skb into the facilities structs |
| 32 | * facilities are written to the debug log file. | 32 | * |
| 33 | * @skb: sk_buff to parse | ||
| 34 | * @facilities: Regular facilites, updated as facilities are found | ||
| 35 | * @dte_facs: ITU DTE facilities, updated as DTE facilities are found | ||
| 36 | * @vc_fac_mask: mask is updated with all facilities found | ||
| 37 | * | ||
| 38 | * Return codes: | ||
| 39 | * -1 - Parsing error, caller should drop call and clean up | ||
| 40 | * 0 - Parse OK, this skb has no facilities | ||
| 41 | * >0 - Parse OK, returns the length of the facilities header | ||
| 42 | * | ||
| 33 | */ | 43 | */ |
| 34 | int x25_parse_facilities(struct sk_buff *skb, struct x25_facilities *facilities, | 44 | int x25_parse_facilities(struct sk_buff *skb, struct x25_facilities *facilities, |
| 35 | struct x25_dte_facilities *dte_facs, unsigned long *vc_fac_mask) | 45 | struct x25_dte_facilities *dte_facs, unsigned long *vc_fac_mask) |
| @@ -62,7 +72,7 @@ int x25_parse_facilities(struct sk_buff *skb, struct x25_facilities *facilities, | |||
| 62 | switch (*p & X25_FAC_CLASS_MASK) { | 72 | switch (*p & X25_FAC_CLASS_MASK) { |
| 63 | case X25_FAC_CLASS_A: | 73 | case X25_FAC_CLASS_A: |
| 64 | if (len < 2) | 74 | if (len < 2) |
| 65 | return 0; | 75 | return -1; |
| 66 | switch (*p) { | 76 | switch (*p) { |
| 67 | case X25_FAC_REVERSE: | 77 | case X25_FAC_REVERSE: |
| 68 | if((p[1] & 0x81) == 0x81) { | 78 | if((p[1] & 0x81) == 0x81) { |
| @@ -107,7 +117,7 @@ int x25_parse_facilities(struct sk_buff *skb, struct x25_facilities *facilities, | |||
| 107 | break; | 117 | break; |
| 108 | case X25_FAC_CLASS_B: | 118 | case X25_FAC_CLASS_B: |
| 109 | if (len < 3) | 119 | if (len < 3) |
| 110 | return 0; | 120 | return -1; |
| 111 | switch (*p) { | 121 | switch (*p) { |
| 112 | case X25_FAC_PACKET_SIZE: | 122 | case X25_FAC_PACKET_SIZE: |
| 113 | facilities->pacsize_in = p[1]; | 123 | facilities->pacsize_in = p[1]; |
| @@ -130,7 +140,7 @@ int x25_parse_facilities(struct sk_buff *skb, struct x25_facilities *facilities, | |||
| 130 | break; | 140 | break; |
| 131 | case X25_FAC_CLASS_C: | 141 | case X25_FAC_CLASS_C: |
| 132 | if (len < 4) | 142 | if (len < 4) |
| 133 | return 0; | 143 | return -1; |
| 134 | printk(KERN_DEBUG "X.25: unknown facility %02X, " | 144 | printk(KERN_DEBUG "X.25: unknown facility %02X, " |
| 135 | "values %02X, %02X, %02X\n", | 145 | "values %02X, %02X, %02X\n", |
| 136 | p[0], p[1], p[2], p[3]); | 146 | p[0], p[1], p[2], p[3]); |
| @@ -139,18 +149,18 @@ int x25_parse_facilities(struct sk_buff *skb, struct x25_facilities *facilities, | |||
| 139 | break; | 149 | break; |
| 140 | case X25_FAC_CLASS_D: | 150 | case X25_FAC_CLASS_D: |
| 141 | if (len < p[1] + 2) | 151 | if (len < p[1] + 2) |
| 142 | return 0; | 152 | return -1; |
| 143 | switch (*p) { | 153 | switch (*p) { |
| 144 | case X25_FAC_CALLING_AE: | 154 | case X25_FAC_CALLING_AE: |
| 145 | if (p[1] > X25_MAX_DTE_FACIL_LEN || p[1] <= 1) | 155 | if (p[1] > X25_MAX_DTE_FACIL_LEN || p[1] <= 1) |
| 146 | return 0; | 156 | return -1; |
| 147 | dte_facs->calling_len = p[2]; | 157 | dte_facs->calling_len = p[2]; |
| 148 | memcpy(dte_facs->calling_ae, &p[3], p[1] - 1); | 158 | memcpy(dte_facs->calling_ae, &p[3], p[1] - 1); |
| 149 | *vc_fac_mask |= X25_MASK_CALLING_AE; | 159 | *vc_fac_mask |= X25_MASK_CALLING_AE; |
| 150 | break; | 160 | break; |
| 151 | case X25_FAC_CALLED_AE: | 161 | case X25_FAC_CALLED_AE: |
| 152 | if (p[1] > X25_MAX_DTE_FACIL_LEN || p[1] <= 1) | 162 | if (p[1] > X25_MAX_DTE_FACIL_LEN || p[1] <= 1) |
| 153 | return 0; | 163 | return -1; |
| 154 | dte_facs->called_len = p[2]; | 164 | dte_facs->called_len = p[2]; |
| 155 | memcpy(dte_facs->called_ae, &p[3], p[1] - 1); | 165 | memcpy(dte_facs->called_ae, &p[3], p[1] - 1); |
| 156 | *vc_fac_mask |= X25_MASK_CALLED_AE; | 166 | *vc_fac_mask |= X25_MASK_CALLED_AE; |
diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c index f729f022be69..15de65f04719 100644 --- a/net/x25/x25_in.c +++ b/net/x25/x25_in.c | |||
| @@ -91,10 +91,10 @@ static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametyp | |||
| 91 | { | 91 | { |
| 92 | struct x25_address source_addr, dest_addr; | 92 | struct x25_address source_addr, dest_addr; |
| 93 | int len; | 93 | int len; |
| 94 | struct x25_sock *x25 = x25_sk(sk); | ||
| 94 | 95 | ||
| 95 | switch (frametype) { | 96 | switch (frametype) { |
| 96 | case X25_CALL_ACCEPTED: { | 97 | case X25_CALL_ACCEPTED: { |
| 97 | struct x25_sock *x25 = x25_sk(sk); | ||
| 98 | 98 | ||
| 99 | x25_stop_timer(sk); | 99 | x25_stop_timer(sk); |
| 100 | x25->condition = 0x00; | 100 | x25->condition = 0x00; |
| @@ -113,14 +113,16 @@ static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametyp | |||
| 113 | &dest_addr); | 113 | &dest_addr); |
| 114 | if (len > 0) | 114 | if (len > 0) |
| 115 | skb_pull(skb, len); | 115 | skb_pull(skb, len); |
| 116 | else if (len < 0) | ||
| 117 | goto out_clear; | ||
| 116 | 118 | ||
| 117 | len = x25_parse_facilities(skb, &x25->facilities, | 119 | len = x25_parse_facilities(skb, &x25->facilities, |
| 118 | &x25->dte_facilities, | 120 | &x25->dte_facilities, |
| 119 | &x25->vc_facil_mask); | 121 | &x25->vc_facil_mask); |
| 120 | if (len > 0) | 122 | if (len > 0) |
| 121 | skb_pull(skb, len); | 123 | skb_pull(skb, len); |
| 122 | else | 124 | else if (len < 0) |
| 123 | return -1; | 125 | goto out_clear; |
| 124 | /* | 126 | /* |
| 125 | * Copy any Call User Data. | 127 | * Copy any Call User Data. |
| 126 | */ | 128 | */ |
| @@ -144,6 +146,12 @@ static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametyp | |||
| 144 | } | 146 | } |
| 145 | 147 | ||
| 146 | return 0; | 148 | return 0; |
| 149 | |||
| 150 | out_clear: | ||
| 151 | x25_write_internal(sk, X25_CLEAR_REQUEST); | ||
| 152 | x25->state = X25_STATE_2; | ||
| 153 | x25_start_t23timer(sk); | ||
| 154 | return 0; | ||
| 147 | } | 155 | } |
| 148 | 156 | ||
| 149 | /* | 157 | /* |
