diff options
author | Eric Dumazet <edumazet@google.com> | 2012-08-23 21:47:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-30 12:32:14 -0400 |
commit | ee13040901c11b016d996ab5a946acaaa3461737 (patch) | |
tree | a2665e1b0605559d28dc0ed30866491272f8d753 /net/core/netpoll.c | |
parent | 6549dd43c04327071571edf7aea4465b16539422 (diff) |
netpoll: provide an IP ident in UDP frames
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>
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r-- | net/core/netpoll.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 346b1eb83a1f..5af9c2692506 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -388,6 +388,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | |||
388 | struct udphdr *udph; | 388 | struct udphdr *udph; |
389 | struct iphdr *iph; | 389 | struct iphdr *iph; |
390 | struct ethhdr *eth; | 390 | struct ethhdr *eth; |
391 | static atomic_t ip_ident; | ||
391 | 392 | ||
392 | udp_len = len + sizeof(*udph); | 393 | udp_len = len + sizeof(*udph); |
393 | ip_len = udp_len + sizeof(*iph); | 394 | ip_len = udp_len + sizeof(*iph); |
@@ -423,7 +424,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | |||
423 | put_unaligned(0x45, (unsigned char *)iph); | 424 | put_unaligned(0x45, (unsigned char *)iph); |
424 | iph->tos = 0; | 425 | iph->tos = 0; |
425 | put_unaligned(htons(ip_len), &(iph->tot_len)); | 426 | put_unaligned(htons(ip_len), &(iph->tot_len)); |
426 | iph->id = 0; | 427 | iph->id = htons(atomic_inc_return(&ip_ident)); |
427 | iph->frag_off = 0; | 428 | iph->frag_off = 0; |
428 | iph->ttl = 64; | 429 | iph->ttl = 64; |
429 | iph->protocol = IPPROTO_UDP; | 430 | iph->protocol = IPPROTO_UDP; |