aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_route.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-11-14 00:34:06 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:53:37 -0500
commit352e512c32b634768303a43768245a0363cebbe7 (patch)
tree97509ac130ecbe2084808271ccc459918a9d5fc1 /net/decnet/dn_route.c
parentb4ce92775c2e7ff9cf79cca4e0a19c8c5fd6287b (diff)
[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 <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/dn_route.c')
-rw-r--r--net/decnet/dn_route.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 23aa3556e56f..2a5bb0714c7e 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -765,17 +765,6 @@ drop:
765} 765}
766 766
767/* 767/*
768 * Drop packet. This is used for endnodes and for
769 * when we should not be forwarding packets from
770 * this dest.
771 */
772static int dn_blackhole(struct sk_buff *skb)
773{
774 kfree_skb(skb);
775 return NET_RX_DROP;
776}
777
778/*
779 * Used to catch bugs. This should never normally get 768 * Used to catch bugs. This should never normally get
780 * called. 769 * called.
781 */ 770 */
@@ -1396,7 +1385,7 @@ make_route:
1396 default: 1385 default:
1397 case RTN_UNREACHABLE: 1386 case RTN_UNREACHABLE:
1398 case RTN_BLACKHOLE: 1387 case RTN_BLACKHOLE:
1399 rt->u.dst.input = dn_blackhole; 1388 rt->u.dst.input = dst_discard;
1400 } 1389 }
1401 rt->rt_flags = flags; 1390 rt->rt_flags = flags;
1402 if (rt->u.dst.dev) 1391 if (rt->u.dst.dev)