Commit ee130409 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6549dd43
...@@ -388,6 +388,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) ...@@ -388,6 +388,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
struct udphdr *udph; struct udphdr *udph;
struct iphdr *iph; struct iphdr *iph;
struct ethhdr *eth; struct ethhdr *eth;
static atomic_t ip_ident;
udp_len = len + sizeof(*udph); udp_len = len + sizeof(*udph);
ip_len = udp_len + sizeof(*iph); ip_len = udp_len + sizeof(*iph);
...@@ -423,7 +424,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) ...@@ -423,7 +424,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
put_unaligned(0x45, (unsigned char *)iph); put_unaligned(0x45, (unsigned char *)iph);
iph->tos = 0; iph->tos = 0;
put_unaligned(htons(ip_len), &(iph->tot_len)); put_unaligned(htons(ip_len), &(iph->tot_len));
iph->id = 0; iph->id = htons(atomic_inc_return(&ip_ident));
iph->frag_off = 0; iph->frag_off = 0;
iph->ttl = 64; iph->ttl = 64;
iph->protocol = IPPROTO_UDP; iph->protocol = IPPROTO_UDP;
......
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