Commit 98a39431 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 3b89d486 158cb909
...@@ -324,8 +324,9 @@ destroy_conntrack(struct nf_conntrack *nfct) ...@@ -324,8 +324,9 @@ destroy_conntrack(struct nf_conntrack *nfct)
ip_conntrack_destroyed(ct); ip_conntrack_destroyed(ct);
WRITE_LOCK(&ip_conntrack_lock); WRITE_LOCK(&ip_conntrack_lock);
/* Delete us from our own list to prevent corruption later */ /* Make sure don't leave any orphaned expectations lying around */
list_del(&ct->sibling_list); if (ct->expecting)
remove_expectations(ct, 1);
/* Delete our master expectation */ /* Delete our master expectation */
if (ct->master) { if (ct->master) {
...@@ -1127,10 +1128,8 @@ int ip_conntrack_alter_reply(struct ip_conntrack *conntrack, ...@@ -1127,10 +1128,8 @@ int ip_conntrack_alter_reply(struct ip_conntrack *conntrack,
DUMP_TUPLE(newreply); DUMP_TUPLE(newreply);
conntrack->tuplehash[IP_CT_DIR_REPLY].tuple = *newreply; conntrack->tuplehash[IP_CT_DIR_REPLY].tuple = *newreply;
if (!conntrack->master) if (!conntrack->master && list_empty(&conntrack->sibling_list))
conntrack->helper = LIST_FIND(&helpers, helper_cmp, conntrack->helper = ip_ct_find_helper(newreply);
struct ip_conntrack_helper *,
newreply);
WRITE_UNLOCK(&ip_conntrack_lock); WRITE_UNLOCK(&ip_conntrack_lock);
return 1; return 1;
......
...@@ -177,6 +177,8 @@ static int tcp_packet(struct ip_conntrack *conntrack, ...@@ -177,6 +177,8 @@ static int tcp_packet(struct ip_conntrack *conntrack,
if (skb_copy_bits(skb, skb->nh.iph->ihl * 4, &tcph, sizeof(tcph)) != 0) if (skb_copy_bits(skb, skb->nh.iph->ihl * 4, &tcph, sizeof(tcph)) != 0)
return -1; return -1;
if (skb->len < skb->nh.iph->ihl * 4 + tcph.doff * 4)
return -1;
/* If only reply is a RST, we can consider ourselves not to /* If only reply is a RST, we can consider ourselves not to
have an established connection: this is a fairly common have an established connection: this is a fairly common
......
...@@ -572,34 +572,26 @@ static void udpv6_mcast_deliver(struct udphdr *uh, ...@@ -572,34 +572,26 @@ static void udpv6_mcast_deliver(struct udphdr *uh,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct sock *sk, *sk2; struct sock *sk, *sk2;
struct sk_buff *buff;
int dif; int dif;
read_lock(&udp_hash_lock); read_lock(&udp_hash_lock);
sk = sk_head(&udp_hash[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]); sk = sk_head(&udp_hash[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]);
dif = skb->dev->ifindex; dif = skb->dev->ifindex;
sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif); sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
if (!sk) if (!sk) {
goto free_skb; kfree_skb(skb);
goto out;
}
buff = NULL;
sk2 = sk; sk2 = sk;
while ((sk2 = udp_v6_mcast_next(sk_next(sk2), uh->dest, daddr, while ((sk2 = udp_v6_mcast_next(sk_next(sk2), uh->dest, daddr,
uh->source, saddr, dif))) { uh->source, saddr, dif))) {
if (!buff) { struct sk_buff *buff = skb_clone(skb, GFP_ATOMIC);
buff = skb_clone(skb, GFP_ATOMIC); if (buff)
if (!buff) udpv6_queue_rcv_skb(sk2, buff);
continue;
}
if (udpv6_queue_rcv_skb(sk2, buff) >= 0)
buff = NULL;
}
if (buff)
kfree_skb(buff);
if (udpv6_queue_rcv_skb(sk, skb) < 0) {
free_skb:
kfree_skb(skb);
} }
udpv6_queue_rcv_skb(sk, skb);
out:
read_unlock(&udp_hash_lock); read_unlock(&udp_hash_lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment