aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-04-08 15:48:52 -0400
committerJiri Kosina <jkosina@suse.cz>2012-04-08 15:48:52 -0400
commite75d660672ddd11704b7f0fdb8ff21968587b266 (patch)
treeccb9c107744c10b553c0373e450bee3971d16c00 /net/atm
parent61282f37927143e45b03153f3e7b48d6b702147a (diff)
parent0034102808e0dbbf3a2394b82b1bb40b5778de9e (diff)
Merge branch 'master' into for-next
Merge with latest Linus' tree, as I have incoming patches that fix code that is newer than current HEAD of for-next. Conflicts: drivers/net/ethernet/realtek/r8169.c
Diffstat (limited to 'net/atm')
-rw-r--r--net/atm/clip.c28
-rw-r--r--net/atm/pppoatm.c2
2 files changed, 20 insertions, 10 deletions
diff --git a/net/atm/clip.c b/net/atm/clip.c
index c12c2582457c..8ae3a7879335 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -37,7 +37,6 @@
37#include <linux/param.h> /* for HZ */ 37#include <linux/param.h> /* for HZ */
38#include <linux/uaccess.h> 38#include <linux/uaccess.h>
39#include <asm/byteorder.h> /* for htons etc. */ 39#include <asm/byteorder.h> /* for htons etc. */
40#include <asm/system.h> /* save/restore_flags */
41#include <linux/atomic.h> 40#include <linux/atomic.h>
42 41
43#include "common.h" 42#include "common.h"
@@ -46,8 +45,8 @@
46 45
47static struct net_device *clip_devs; 46static struct net_device *clip_devs;
48static struct atm_vcc *atmarpd; 47static struct atm_vcc *atmarpd;
49static struct neigh_table clip_tbl;
50static struct timer_list idle_timer; 48static struct timer_list idle_timer;
49static const struct neigh_ops clip_neigh_ops;
51 50
52static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip) 51static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip)
53{ 52{
@@ -123,6 +122,8 @@ static int neigh_check_cb(struct neighbour *n)
123 struct atmarp_entry *entry = neighbour_priv(n); 122 struct atmarp_entry *entry = neighbour_priv(n);
124 struct clip_vcc *cv; 123 struct clip_vcc *cv;
125 124
125 if (n->ops != &clip_neigh_ops)
126 return 0;
126 for (cv = entry->vccs; cv; cv = cv->next) { 127 for (cv = entry->vccs; cv; cv = cv->next) {
127 unsigned long exp = cv->last_use + cv->idle_timeout; 128 unsigned long exp = cv->last_use + cv->idle_timeout;
128 129
@@ -154,10 +155,10 @@ static int neigh_check_cb(struct neighbour *n)
154 155
155static void idle_timer_check(unsigned long dummy) 156static void idle_timer_check(unsigned long dummy)
156{ 157{
157 write_lock(&clip_tbl.lock); 158 write_lock(&arp_tbl.lock);
158 __neigh_for_each_release(&clip_tbl, neigh_check_cb); 159 __neigh_for_each_release(&arp_tbl, neigh_check_cb);
159 mod_timer(&idle_timer, jiffies + CLIP_CHECK_INTERVAL * HZ); 160 mod_timer(&idle_timer, jiffies + CLIP_CHECK_INTERVAL * HZ);
160 write_unlock(&clip_tbl.lock); 161 write_unlock(&arp_tbl.lock);
161} 162}
162 163
163static int clip_arp_rcv(struct sk_buff *skb) 164static int clip_arp_rcv(struct sk_buff *skb)
@@ -328,6 +329,8 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
328 struct atmarp_entry *entry; 329 struct atmarp_entry *entry;
329 struct neighbour *n; 330 struct neighbour *n;
330 struct atm_vcc *vcc; 331 struct atm_vcc *vcc;
332 struct rtable *rt;
333 __be32 *daddr;
331 int old; 334 int old;
332 unsigned long flags; 335 unsigned long flags;
333 336
@@ -338,7 +341,12 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
338 dev->stats.tx_dropped++; 341 dev->stats.tx_dropped++;
339 return NETDEV_TX_OK; 342 return NETDEV_TX_OK;
340 } 343 }
341 n = dst_get_neighbour_noref(dst); 344 rt = (struct rtable *) dst;
345 if (rt->rt_gateway)
346 daddr = &rt->rt_gateway;
347 else
348 daddr = &ip_hdr(skb)->daddr;
349 n = dst_neigh_lookup(dst, daddr);
342 if (!n) { 350 if (!n) {
343 pr_err("NO NEIGHBOUR !\n"); 351 pr_err("NO NEIGHBOUR !\n");
344 dev_kfree_skb(skb); 352 dev_kfree_skb(skb);
@@ -358,7 +366,7 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
358 dev_kfree_skb(skb); 366 dev_kfree_skb(skb);
359 dev->stats.tx_dropped++; 367 dev->stats.tx_dropped++;
360 } 368 }
361 return NETDEV_TX_OK; 369 goto out_release_neigh;
362 } 370 }
363 pr_debug("neigh %p, vccs %p\n", entry, entry->vccs); 371 pr_debug("neigh %p, vccs %p\n", entry, entry->vccs);
364 ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc; 372 ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc;
@@ -377,14 +385,14 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
377 old = xchg(&entry->vccs->xoff, 1); /* assume XOFF ... */ 385 old = xchg(&entry->vccs->xoff, 1); /* assume XOFF ... */
378 if (old) { 386 if (old) {
379 pr_warning("XOFF->XOFF transition\n"); 387 pr_warning("XOFF->XOFF transition\n");
380 return NETDEV_TX_OK; 388 goto out_release_neigh;
381 } 389 }
382 dev->stats.tx_packets++; 390 dev->stats.tx_packets++;
383 dev->stats.tx_bytes += skb->len; 391 dev->stats.tx_bytes += skb->len;
384 vcc->send(vcc, skb); 392 vcc->send(vcc, skb);
385 if (atm_may_send(vcc, 0)) { 393 if (atm_may_send(vcc, 0)) {
386 entry->vccs->xoff = 0; 394 entry->vccs->xoff = 0;
387 return NETDEV_TX_OK; 395 goto out_release_neigh;
388 } 396 }
389 spin_lock_irqsave(&clip_priv->xoff_lock, flags); 397 spin_lock_irqsave(&clip_priv->xoff_lock, flags);
390 netif_stop_queue(dev); /* XOFF -> throttle immediately */ 398 netif_stop_queue(dev); /* XOFF -> throttle immediately */
@@ -396,6 +404,8 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
396 of the brief netif_stop_queue. If this isn't true or if it 404 of the brief netif_stop_queue. If this isn't true or if it
397 changes, use netif_wake_queue instead. */ 405 changes, use netif_wake_queue instead. */
398 spin_unlock_irqrestore(&clip_priv->xoff_lock, flags); 406 spin_unlock_irqrestore(&clip_priv->xoff_lock, flags);
407out_release_neigh:
408 neigh_release(n);
399 return NETDEV_TX_OK; 409 return NETDEV_TX_OK;
400} 410}
401 411
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
index df35d9a3b5fe..614d3fc47ede 100644
--- a/net/atm/pppoatm.c
+++ b/net/atm/pppoatm.c
@@ -44,7 +44,7 @@
44#include <linux/atmdev.h> 44#include <linux/atmdev.h>
45#include <linux/capability.h> 45#include <linux/capability.h>
46#include <linux/ppp_defs.h> 46#include <linux/ppp_defs.h>
47#include <linux/if_ppp.h> 47#include <linux/ppp-ioctl.h>
48#include <linux/ppp_channel.h> 48#include <linux/ppp_channel.h>
49#include <linux/atmppp.h> 49#include <linux/atmppp.h>
50 50