Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78090
b: refs/heads/master
c: 352e512
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 28, 2008
1 parent 408ab7a commit cff1838
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 50 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4ce92775c2e7ff9cf79cca4e0a19c8c5fd6287b
refs/heads/master: 352e512c32b634768303a43768245a0363cebbe7
1 change: 1 addition & 0 deletions trunk/include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ static inline struct dst_entry *dst_pop(struct dst_entry *dst)
return child;
}

extern int dst_discard(struct sk_buff *skb);
extern void * dst_alloc(struct dst_ops * ops);
extern void __dst_free(struct dst_entry * dst);
extern struct dst_entry *dst_destroy(struct dst_entry * dst);
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/core/dst.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ static void dst_gc_task(struct work_struct *work)
#endif
}

static int dst_discard(struct sk_buff *skb)
int dst_discard(struct sk_buff *skb)
{
kfree_skb(skb);
return 0;
}
EXPORT_SYMBOL(dst_discard);

void * dst_alloc(struct dst_ops * ops)
{
Expand Down
13 changes: 1 addition & 12 deletions trunk/net/decnet/dn_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,17 +764,6 @@ static int dn_forward(struct sk_buff *skb)
return NET_RX_DROP;
}

/*
* Drop packet. This is used for endnodes and for
* when we should not be forwarding packets from
* this dest.
*/
static int dn_blackhole(struct sk_buff *skb)
{
kfree_skb(skb);
return NET_RX_DROP;
}

/*
* Used to catch bugs. This should never normally get
* called.
Expand Down Expand Up @@ -1396,7 +1385,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
default:
case RTN_UNREACHABLE:
case RTN_BLACKHOLE:
rt->u.dst.input = dn_blackhole;
rt->u.dst.input = dst_discard;
}
rt->rt_flags = flags;
if (rt->u.dst.dev)
Expand Down
11 changes: 3 additions & 8 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
#include <linux/jhash.h>
#include <linux/rcupdate.h>
#include <linux/times.h>
#include <net/dst.h>
#include <net/net_namespace.h>
#include <net/protocol.h>
#include <net/ip.h>
Expand Down Expand Up @@ -2357,12 +2358,6 @@ static struct dst_ops ipv4_dst_blackhole_ops = {
};


static int ipv4_blackhole_output(struct sk_buff *skb)
{
kfree_skb(skb);
return 0;
}

static int ipv4_dst_blackhole(struct rtable **rp, struct flowi *flp, struct sock *sk)
{
struct rtable *ort = *rp;
Expand All @@ -2374,8 +2369,8 @@ static int ipv4_dst_blackhole(struct rtable **rp, struct flowi *flp, struct sock

atomic_set(&new->__refcnt, 1);
new->__use = 1;
new->input = ipv4_blackhole_output;
new->output = ipv4_blackhole_output;
new->input = dst_discard;
new->output = dst_discard;
memcpy(new->metrics, ort->u.dst.metrics, RTAX_MAX*sizeof(u32));

new->dev = ort->u.dst.dev;
Expand Down
13 changes: 2 additions & 11 deletions trunk/net/ipv6/exthdrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/in6.h>
#include <linux/icmpv6.h>

#include <net/dst.h>
#include <net/sock.h>
#include <net/snmp.h>

Expand Down Expand Up @@ -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,
};

Expand Down
21 changes: 4 additions & 17 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ struct rt6_info ip6_null_entry = {

static int ip6_pkt_prohibit(struct sk_buff *skb);
static int ip6_pkt_prohibit_out(struct sk_buff *skb);
static int ip6_pkt_blk_hole(struct sk_buff *skb);

struct rt6_info ip6_prohibit_entry = {
.u = {
Expand Down Expand Up @@ -181,8 +180,8 @@ struct rt6_info ip6_blk_hole_entry = {
.obsolete = -1,
.error = -EINVAL,
.metrics = { [RTAX_HOPLIMIT - 1] = 255, },
.input = ip6_pkt_blk_hole,
.output = ip6_pkt_blk_hole,
.input = dst_discard,
.output = dst_discard,
.ops = &ip6_dst_ops,
.path = (struct dst_entry*)&ip6_blk_hole_entry,
}
Expand Down Expand Up @@ -782,12 +781,6 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)

EXPORT_SYMBOL(ip6_route_output);

static int ip6_blackhole_output(struct sk_buff *skb)
{
kfree_skb(skb);
return 0;
}

int ip6_dst_blackhole(struct sock *sk, struct dst_entry **dstp, struct flowi *fl)
{
struct rt6_info *ort = (struct rt6_info *) *dstp;
Expand All @@ -800,8 +793,8 @@ int ip6_dst_blackhole(struct sock *sk, struct dst_entry **dstp, struct flowi *fl

atomic_set(&new->__refcnt, 1);
new->__use = 1;
new->input = ip6_blackhole_output;
new->output = ip6_blackhole_output;
new->input = dst_discard;
new->output = dst_discard;

memcpy(new->metrics, ort->u.dst.metrics, RTAX_MAX*sizeof(u32));
new->dev = ort->u.dst.dev;
Expand Down Expand Up @@ -1811,12 +1804,6 @@ static int ip6_pkt_prohibit_out(struct sk_buff *skb)
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
}

static int ip6_pkt_blk_hole(struct sk_buff *skb)
{
kfree_skb(skb);
return 0;
}

#endif

/*
Expand Down

0 comments on commit cff1838

Please sign in to comment.