1
0
mirror of https://passt.top/passt synced 2024-07-01 23:42:41 +00:00

udp: drop bogus udp_tap_map ts assignment

The 'ts' field is a timestamp so assigning the socket file descriptor is
incorrect. There is no actual bug because the current time is assigned
just a few lines later:

      udp_tap_map[V4][src].sock = s;
      udp_tap_map[V4][src].ts = s;
      ^^^^^^^^^^^ bogus ^^^^^^^^^^
      bitmap_set(udp_act[V4][UDP_ACT_TAP], src);
  }

  udp_tap_map[V4][src].ts = now->tv_sec;
  ^^^^^^^^^^^^^^^ correct ^^^^^^^^^^^^^^

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2021-10-15 11:27:17 +01:00 committed by Stefano Brivio
parent 6231422dfb
commit 14fe73e766

1
udp.c
View File

@ -927,7 +927,6 @@ int udp_tap_handler(struct ctx *c, int af, void *addr,
return count;
udp_tap_map[V4][src].sock = s;
udp_tap_map[V4][src].ts = s;
bitmap_set(udp_act[V4][UDP_ACT_TAP], src);
}