]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
netpoll: provide an IP ident in UDP frames
authorEric Dumazet <edumazet@google.com>
Fri, 24 Aug 2012 01:47:26 +0000 (01:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Aug 2012 16:32:14 +0000 (12:32 -0400)
Let's fill IP header ident field with a meaningful value,
it might help some setups.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/netpoll.c

index 346b1eb83a1f0336ed1e9dcf4f5905b733022dff..5af9c269250681f27593cb7f3fd46b2d6e12e998 100644 (file)
@@ -388,6 +388,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
        struct udphdr *udph;
        struct iphdr *iph;
        struct ethhdr *eth;
+       static atomic_t ip_ident;
 
        udp_len = len + sizeof(*udph);
        ip_len = udp_len + sizeof(*iph);
@@ -423,7 +424,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
        put_unaligned(0x45, (unsigned char *)iph);
        iph->tos      = 0;
        put_unaligned(htons(ip_len), &(iph->tot_len));
-       iph->id       = 0;
+       iph->id       = htons(atomic_inc_return(&ip_ident));
        iph->frag_off = 0;
        iph->ttl      = 64;
        iph->protocol = IPPROTO_UDP;