Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122702
b: refs/heads/master
c: 0eae1b9
h: refs/heads/master
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Dec 15, 2008
1 parent 806fcfc commit dd1891a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 27 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: ebad5c0984e06f4036d2eb2741b9afce736b8a06
refs/heads/master: 0eae1b98cf3022715b5a6ea5f1ac6b0bd7ac4edd
41 changes: 15 additions & 26 deletions trunk/net/ax25/ax25_in.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,15 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,

skb_reset_transport_header(skb);

if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) {
kfree_skb(skb);
return 0;
}
if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL)
goto free;

/*
* Parse the address header.
*/

if (ax25_addr_parse(skb->data, skb->len, &src, &dest, &dp, &type, &dama) == NULL) {
kfree_skb(skb);
return 0;
}
if (ax25_addr_parse(skb->data, skb->len, &src, &dest, &dp, &type, &dama) == NULL)
goto free;

/*
* Ours perhaps ?
Expand All @@ -239,10 +235,8 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,

ax25_send_to_raw(&dest, skb, skb->data[1]);

if (!mine && ax25cmp(&dest, (ax25_address *)dev->broadcast) != 0) {
kfree_skb(skb);
return 0;
}
if (!mine && ax25cmp(&dest, (ax25_address *)dev->broadcast) != 0)
goto free;

/* Now we are pointing at the pid byte */
switch (skb->data[1]) {
Expand Down Expand Up @@ -301,10 +295,8 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
* If not, should we DM the incoming frame (except DMs) or
* silently ignore them. For now we stay quiet.
*/
if (ax25_dev->values[AX25_VALUES_CONMODE] == 0) {
kfree_skb(skb);
return 0;
}
if (ax25_dev->values[AX25_VALUES_CONMODE] == 0)
goto free;

/* LAPB */

Expand Down Expand Up @@ -339,8 +331,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
if ((*skb->data & ~AX25_PF) != AX25_DM && mine)
ax25_return_dm(dev, &src, &dest, &dp);

kfree_skb(skb);
return 0;
goto free;
}

/* b) received SABM(E) */
Expand Down Expand Up @@ -372,15 +363,12 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
sk->sk_ack_backlog++;
bh_unlock_sock(sk);
} else {
if (!mine) {
kfree_skb(skb);
return 0;
}
if (!mine)
goto free;

if ((ax25 = ax25_create_cb()) == NULL) {
ax25_return_dm(dev, &src, &dest, &dp);
kfree_skb(skb);
return 0;
goto free;
}

ax25_fillin_cb(ax25, ax25_dev);
Expand Down Expand Up @@ -436,9 +424,10 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_data_ready(sk, skb->len);
sock_put(sk);
} else
} else {
free:
kfree_skb(skb);

}
return 0;
}

Expand Down

0 comments on commit dd1891a

Please sign in to comment.