diff options
Diffstat (limited to 'net/appletalk')
-rw-r--r-- | net/appletalk/ddp.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 875eda5dbad7..0d42d5da50ad 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
@@ -1400,7 +1400,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev, | |||
1400 | __u16 len_hops; | 1400 | __u16 len_hops; |
1401 | 1401 | ||
1402 | if (!net_eq(dev_net(dev), &init_net)) | 1402 | if (!net_eq(dev_net(dev), &init_net)) |
1403 | goto freeit; | 1403 | goto drop; |
1404 | 1404 | ||
1405 | /* Don't mangle buffer if shared */ | 1405 | /* Don't mangle buffer if shared */ |
1406 | if (!(skb = skb_share_check(skb, GFP_ATOMIC))) | 1406 | if (!(skb = skb_share_check(skb, GFP_ATOMIC))) |
@@ -1408,7 +1408,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev, | |||
1408 | 1408 | ||
1409 | /* Size check and make sure header is contiguous */ | 1409 | /* Size check and make sure header is contiguous */ |
1410 | if (!pskb_may_pull(skb, sizeof(*ddp))) | 1410 | if (!pskb_may_pull(skb, sizeof(*ddp))) |
1411 | goto freeit; | 1411 | goto drop; |
1412 | 1412 | ||
1413 | ddp = ddp_hdr(skb); | 1413 | ddp = ddp_hdr(skb); |
1414 | 1414 | ||
@@ -1426,7 +1426,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev, | |||
1426 | if (skb->len < sizeof(*ddp) || skb->len < (len_hops & 1023)) { | 1426 | if (skb->len < sizeof(*ddp) || skb->len < (len_hops & 1023)) { |
1427 | pr_debug("AppleTalk: dropping corrupted frame (deh_len=%u, " | 1427 | pr_debug("AppleTalk: dropping corrupted frame (deh_len=%u, " |
1428 | "skb->len=%u)\n", len_hops & 1023, skb->len); | 1428 | "skb->len=%u)\n", len_hops & 1023, skb->len); |
1429 | goto freeit; | 1429 | goto drop; |
1430 | } | 1430 | } |
1431 | 1431 | ||
1432 | /* | 1432 | /* |
@@ -1436,7 +1436,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev, | |||
1436 | if (ddp->deh_sum && | 1436 | if (ddp->deh_sum && |
1437 | atalk_checksum(skb, len_hops & 1023) != ddp->deh_sum) | 1437 | atalk_checksum(skb, len_hops & 1023) != ddp->deh_sum) |
1438 | /* Not a valid AppleTalk frame - dustbin time */ | 1438 | /* Not a valid AppleTalk frame - dustbin time */ |
1439 | goto freeit; | 1439 | goto drop; |
1440 | 1440 | ||
1441 | /* Check the packet is aimed at us */ | 1441 | /* Check the packet is aimed at us */ |
1442 | if (!ddp->deh_dnet) /* Net 0 is 'this network' */ | 1442 | if (!ddp->deh_dnet) /* Net 0 is 'this network' */ |
@@ -1449,7 +1449,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev, | |||
1449 | * AppleTalk iface | 1449 | * AppleTalk iface |
1450 | */ | 1450 | */ |
1451 | atalk_route_packet(skb, dev, ddp, len_hops, origlen); | 1451 | atalk_route_packet(skb, dev, ddp, len_hops, origlen); |
1452 | goto out; | 1452 | return NET_RX_SUCCESS; |
1453 | } | 1453 | } |
1454 | 1454 | ||
1455 | /* if IP over DDP is not selected this code will be optimized out */ | 1455 | /* if IP over DDP is not selected this code will be optimized out */ |
@@ -1465,18 +1465,21 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev, | |||
1465 | 1465 | ||
1466 | sock = atalk_search_socket(&tosat, atif); | 1466 | sock = atalk_search_socket(&tosat, atif); |
1467 | if (!sock) /* But not one of our sockets */ | 1467 | if (!sock) /* But not one of our sockets */ |
1468 | goto freeit; | 1468 | goto drop; |
1469 | 1469 | ||
1470 | /* Queue packet (standard) */ | 1470 | /* Queue packet (standard) */ |
1471 | skb->sk = sock; | 1471 | skb->sk = sock; |
1472 | 1472 | ||
1473 | if (sock_queue_rcv_skb(sock, skb) < 0) | 1473 | if (sock_queue_rcv_skb(sock, skb) < 0) |
1474 | goto freeit; | 1474 | goto drop; |
1475 | out: | 1475 | |
1476 | return 0; | 1476 | return NET_RX_SUCCESS; |
1477 | freeit: | 1477 | |
1478 | drop: | ||
1478 | kfree_skb(skb); | 1479 | kfree_skb(skb); |
1479 | goto out; | 1480 | out: |
1481 | return NET_RX_DROP; | ||
1482 | |||
1480 | } | 1483 | } |
1481 | 1484 | ||
1482 | /* | 1485 | /* |