Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8699
b: refs/heads/master
c: 3f2aadd
h: refs/heads/master
i:
  8697: 079352a
  8695: 2d95e9a
v: v3
  • Loading branch information
Ralf Baechle authored and David S. Miller committed Sep 12, 2005
1 parent 168dc60 commit 01648ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6f74998e5c3b4610e6eba06babf16547369c512a
refs/heads/master: 3f2aadd041a7a3e732d182c3770b3fa95a2300b2
44 changes: 15 additions & 29 deletions trunk/net/netrom/nr_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,10 @@ int nr_rx_ip(struct sk_buff *skb, struct net_device *dev)

static int nr_rebuild_header(struct sk_buff *skb)
{
struct net_device *dev = skb->dev;
struct net_device_stats *stats = netdev_priv(dev);
struct sk_buff *skbn;
unsigned char *bp = skb->data;
int len;

if (arp_find(bp + 7, skb)) {
if (arp_find(bp + 7, skb))
return 1;
}

bp[6] &= ~AX25_CBIT;
bp[6] &= ~AX25_EBIT;
Expand All @@ -90,27 +85,7 @@ static int nr_rebuild_header(struct sk_buff *skb)
bp[6] |= AX25_EBIT;
bp[6] |= AX25_SSSID_SPARE;

if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
kfree_skb(skb);
return 1;
}

if (skb->sk != NULL)
skb_set_owner_w(skbn, skb->sk);

kfree_skb(skb);

len = skbn->len;

if (!nr_route_frame(skbn, NULL)) {
kfree_skb(skbn);
stats->tx_errors++;
}

stats->tx_packets++;
stats->tx_bytes += len;

return 1;
return 0;
}

#else
Expand Down Expand Up @@ -186,8 +161,19 @@ static int nr_close(struct net_device *dev)
static int nr_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct net_device_stats *stats = netdev_priv(dev);
dev_kfree_skb(skb);
stats->tx_errors++;
unsigned int len;

len = skb->len;

if (!nr_route_frame(skb, NULL)) {
kfree_skb(skb);
stats->tx_errors++;
return 0;
}

stats->tx_packets++;
stats->tx_bytes += len;

return 0;
}

Expand Down

0 comments on commit 01648ed

Please sign in to comment.