diff options
author | Patrick McHardy <kaber@trash.net> | 2005-08-09 19:45:02 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 15:37:22 -0700 |
commit | d13964f4490157b8a290903362bfbc54f750a6bc (patch) | |
tree | 377297846b513224a30185fb279afd6640e361f5 /net/ipv4/raw.c | |
parent | 0bd1b59b15e4057101c89d4db15a3683c0d897f7 (diff) | |
download | kernel_goldelico_gta04-d13964f4490157b8a290903362bfbc54f750a6bc.zip kernel_goldelico_gta04-d13964f4490157b8a290903362bfbc54f750a6bc.tar.gz kernel_goldelico_gta04-d13964f4490157b8a290903362bfbc54f750a6bc.tar.bz2 |
[IPV4/6]: Check if packet was actually delivered to a raw socket to decide whether to send an ICMP unreachable
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r-- | net/ipv4/raw.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index d1835b1..e222c5c 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -150,10 +150,11 @@ static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb) * RFC 1122: SHOULD pass TOS value up to the transport layer. * -> It does. And not only TOS, but all IP header. */ -void raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash) +int raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash) { struct sock *sk; struct hlist_head *head; + int delivered = 0; read_lock(&raw_v4_lock); head = &raw_v4_htable[hash]; @@ -164,6 +165,7 @@ void raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash) skb->dev->ifindex); while (sk) { + delivered = 1; if (iph->protocol != IPPROTO_ICMP || !icmp_filter(sk, skb)) { struct sk_buff *clone = skb_clone(skb, GFP_ATOMIC); @@ -177,6 +179,7 @@ void raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash) } out: read_unlock(&raw_v4_lock); + return delivered; } void raw_err (struct sock *sk, struct sk_buff *skb, u32 info) |