|
@@ -1400,7 +1400,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
|
|
__u16 len_hops;
|
|
__u16 len_hops;
|
|
|
|
|
|
if (!net_eq(dev_net(dev), &init_net))
|
|
if (!net_eq(dev_net(dev), &init_net))
|
|
- goto freeit;
|
|
|
|
|
|
+ goto drop;
|
|
|
|
|
|
/* Don't mangle buffer if shared */
|
|
/* Don't mangle buffer if shared */
|
|
if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
|
|
if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
|
|
@@ -1408,7 +1408,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
|
|
|
|
|
|
/* Size check and make sure header is contiguous */
|
|
/* Size check and make sure header is contiguous */
|
|
if (!pskb_may_pull(skb, sizeof(*ddp)))
|
|
if (!pskb_may_pull(skb, sizeof(*ddp)))
|
|
- goto freeit;
|
|
|
|
|
|
+ goto drop;
|
|
|
|
|
|
ddp = ddp_hdr(skb);
|
|
ddp = ddp_hdr(skb);
|
|
|
|
|
|
@@ -1426,7 +1426,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
|
|
if (skb->len < sizeof(*ddp) || skb->len < (len_hops & 1023)) {
|
|
if (skb->len < sizeof(*ddp) || skb->len < (len_hops & 1023)) {
|
|
pr_debug("AppleTalk: dropping corrupted frame (deh_len=%u, "
|
|
pr_debug("AppleTalk: dropping corrupted frame (deh_len=%u, "
|
|
"skb->len=%u)\n", len_hops & 1023, skb->len);
|
|
"skb->len=%u)\n", len_hops & 1023, skb->len);
|
|
- goto freeit;
|
|
|
|
|
|
+ goto drop;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -1436,7 +1436,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
|
|
if (ddp->deh_sum &&
|
|
if (ddp->deh_sum &&
|
|
atalk_checksum(skb, len_hops & 1023) != ddp->deh_sum)
|
|
atalk_checksum(skb, len_hops & 1023) != ddp->deh_sum)
|
|
/* Not a valid AppleTalk frame - dustbin time */
|
|
/* Not a valid AppleTalk frame - dustbin time */
|
|
- goto freeit;
|
|
|
|
|
|
+ goto drop;
|
|
|
|
|
|
/* Check the packet is aimed at us */
|
|
/* Check the packet is aimed at us */
|
|
if (!ddp->deh_dnet) /* Net 0 is 'this network' */
|
|
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,
|
|
* AppleTalk iface
|
|
* AppleTalk iface
|
|
*/
|
|
*/
|
|
atalk_route_packet(skb, dev, ddp, len_hops, origlen);
|
|
atalk_route_packet(skb, dev, ddp, len_hops, origlen);
|
|
- goto out;
|
|
|
|
|
|
+ return NET_RX_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
/* if IP over DDP is not selected this code will be optimized out */
|
|
/* 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,
|
|
|
|
|
|
sock = atalk_search_socket(&tosat, atif);
|
|
sock = atalk_search_socket(&tosat, atif);
|
|
if (!sock) /* But not one of our sockets */
|
|
if (!sock) /* But not one of our sockets */
|
|
- goto freeit;
|
|
|
|
|
|
+ goto drop;
|
|
|
|
|
|
/* Queue packet (standard) */
|
|
/* Queue packet (standard) */
|
|
skb->sk = sock;
|
|
skb->sk = sock;
|
|
|
|
|
|
if (sock_queue_rcv_skb(sock, skb) < 0)
|
|
if (sock_queue_rcv_skb(sock, skb) < 0)
|
|
- goto freeit;
|
|
|
|
-out:
|
|
|
|
- return 0;
|
|
|
|
-freeit:
|
|
|
|
|
|
+ goto drop;
|
|
|
|
+
|
|
|
|
+ return NET_RX_SUCCESS;
|
|
|
|
+
|
|
|
|
+drop:
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
- goto out;
|
|
|
|
|
|
+out:
|
|
|
|
+ return NET_RX_DROP;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|