aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose/rose_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rose/rose_dev.c')
-rw-r--r--net/rose/rose_dev.c38
1 files changed, 11 insertions, 27 deletions
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c
index 24d2b40b6c6b..90209c1fa49b 100644
--- a/net/rose/rose_dev.c
+++ b/net/rose/rose_dev.c
@@ -59,38 +59,14 @@ static int rose_header(struct sk_buff *skb, struct net_device *dev,
59static int rose_rebuild_header(struct sk_buff *skb) 59static int rose_rebuild_header(struct sk_buff *skb)
60{ 60{
61#ifdef CONFIG_INET 61#ifdef CONFIG_INET
62 struct net_device *dev = skb->dev;
63 struct net_device_stats *stats = &dev->stats;
64 unsigned char *bp = (unsigned char *)skb->data; 62 unsigned char *bp = (unsigned char *)skb->data;
65 struct sk_buff *skbn;
66 unsigned int len;
67 63
68 if (arp_find(bp + 7, skb)) { 64 if (arp_find(bp + 7, skb)) {
69 return 1; 65 return 1;
70 } 66 }
71 67
72 if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
73 kfree_skb(skb);
74 return 1;
75 }
76
77 if (skb->sk != NULL)
78 skb_set_owner_w(skbn, skb->sk);
79
80 kfree_skb(skb);
81
82 len = skbn->len;
83
84 if (!rose_route_frame(skbn, NULL)) {
85 kfree_skb(skbn);
86 stats->tx_errors++;
87 return 1;
88 }
89
90 stats->tx_packets++;
91 stats->tx_bytes += len;
92#endif 68#endif
93 return 1; 69 return 0;
94} 70}
95 71
96static int rose_set_mac_address(struct net_device *dev, void *addr) 72static int rose_set_mac_address(struct net_device *dev, void *addr)
@@ -137,13 +113,21 @@ static int rose_close(struct net_device *dev)
137static netdev_tx_t rose_xmit(struct sk_buff *skb, struct net_device *dev) 113static netdev_tx_t rose_xmit(struct sk_buff *skb, struct net_device *dev)
138{ 114{
139 struct net_device_stats *stats = &dev->stats; 115 struct net_device_stats *stats = &dev->stats;
116 unsigned int len = skb->len;
140 117
141 if (!netif_running(dev)) { 118 if (!netif_running(dev)) {
142 printk(KERN_ERR "ROSE: rose_xmit - called when iface is down\n"); 119 printk(KERN_ERR "ROSE: rose_xmit - called when iface is down\n");
143 return NETDEV_TX_BUSY; 120 return NETDEV_TX_BUSY;
144 } 121 }
145 dev_kfree_skb(skb); 122
146 stats->tx_errors++; 123 if (!rose_route_frame(skb, NULL)) {
124 dev_kfree_skb(skb);
125 stats->tx_errors++;
126 return NETDEV_TX_OK;
127 }
128
129 stats->tx_packets++;
130 stats->tx_bytes += len;
147 return NETDEV_TX_OK; 131 return NETDEV_TX_OK;
148} 132}
149 133