From 352e512c32b634768303a43768245a0363cebbe7 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 13 Nov 2007 21:34:06 -0800 Subject: [NET]: Eliminate duplicate copies of dst_discard We have a number of copies of dst_discard scattered around the place which all do the same thing, namely free a packet on the input or output paths. This patch deletes all of them except dst_discard and points all the users to it. The only non-trivial bit is decnet where it returns an error. However, conceptually this is identical to the blackhole functions used in IPv4 and IPv6 which do not return errors. So they should either all return errors or all return zero. For now I've stuck with the majority and picked zero as the return value. It doesn't really matter in practice since few if any driver would react differently depending on a zero return value or NET_RX_DROP. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- net/ipv6/exthdrs.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'net/ipv6/exthdrs.c') diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 1e89efd38a0c..cee06b1655c1 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -318,18 +319,8 @@ void __init ipv6_destopt_init(void) printk(KERN_ERR "ipv6_destopt_init: Could not register protocol\n"); } -/******************************** - NONE header. No data in packet. - ********************************/ - -static int ipv6_nodata_rcv(struct sk_buff *skb) -{ - kfree_skb(skb); - return 0; -} - static struct inet6_protocol nodata_protocol = { - .handler = ipv6_nodata_rcv, + .handler = dst_discard, .flags = INET6_PROTO_NOPOLICY, }; -- cgit v1.2.3