From: Alexey Kuznetsov Date: Wed, 22 Mar 2006 22:27:59 +0000 (-0800) Subject: [TCP]: Do not use inet->id of global tcp_socket when sending RST. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1a55d57b107c3e06935763905dc0fb235214569d;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [TCP]: Do not use inet->id of global tcp_socket when sending RST. The problem is in ip_push_pending_frames(), which uses: if (!df) { __ip_select_ident(iph, &rt->u.dst, 0); } else { iph->id = htons(inet->id++); } instead of ip_select_ident(). Right now I think the code is a nonsense. Most likely, I copied it from old ip_build_xmit(), where it was really special, we had to decide whether to generate unique ID when generating the first (well, the last) fragment. In ip_push_pending_frames() it does not make sense, it should use plain ip_select_ident() instead. Signed-off-by: Alexey Kuznetsov Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 8ee4d016740..f75ff1d9655 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -1249,11 +1249,7 @@ int ip_push_pending_frames(struct sock *sk) iph->tos = inet->tos; iph->tot_len = htons(skb->len); iph->frag_off = df; - if (!df) { - __ip_select_ident(iph, &rt->u.dst, 0); - } else { - iph->id = htons(inet->id++); - } + ip_select_ident(iph, &rt->u.dst, sk); iph->ttl = ttl; iph->protocol = sk->sk_protocol; iph->saddr = rt->rt_src;