Skip to content

Commit ee13040

Browse files
edumazetdavem330
authored andcommitted
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>
1 parent 6549dd4 commit ee13040

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/core/netpoll.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
388388
struct udphdr *udph;
389389
struct iphdr *iph;
390390
struct ethhdr *eth;
391+
static atomic_t ip_ident;
391392

392393
udp_len = len + sizeof(*udph);
393394
ip_len = udp_len + sizeof(*iph);
@@ -423,7 +424,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
423424
put_unaligned(0x45, (unsigned char *)iph);
424425
iph->tos = 0;
425426
put_unaligned(htons(ip_len), &(iph->tot_len));
426-
iph->id = 0;
427+
iph->id = htons(atomic_inc_return(&ip_ident));
427428
iph->frag_off = 0;
428429
iph->ttl = 64;
429430
iph->protocol = IPPROTO_UDP;

0 commit comments

Comments
 (0)