Skip to content

Commit

Permalink
ipv6: correct return on ipv6_rcv() packet drop
Browse files Browse the repository at this point in the history
The routine ipv6_rcv() uses magic number 0 for a return when it drops a
packet. This corresponds to NET_RX_SUCCESS, which is obviously
incorrect. Correct this by using NET_RX_DROP instead.

ps. It isn't exactly clear who the IPv6 maintainers are, apologies if
I've missed any.

Signed-off-by: Mark Smith <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Mark Smith authored and davem330 committed Jul 7, 2009
1 parent b7cb8c2 commit 5c91fac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/ipv6/ip6_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt

if (skb->pkt_type == PACKET_OTHERHOST) {
kfree_skb(skb);
return 0;
return NET_RX_DROP;
}

rcu_read_lock();
Expand Down Expand Up @@ -133,7 +133,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
if (ipv6_parse_hopopts(skb) < 0) {
IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_INHDRERRORS);
rcu_read_unlock();
return 0;
return NET_RX_DROP;
}
}

Expand All @@ -149,7 +149,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
drop:
rcu_read_unlock();
kfree_skb(skb);
return 0;
return NET_RX_DROP;
}

/*
Expand Down

0 comments on commit 5c91fac

Please sign in to comment.