1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-07 08:25:34 +02:00

passt: Add clang-tidy Makefile target and test, take care of warnings

Most are just about style and form, but a few were actually
serious mistakes (NDP-related).

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-10-20 00:05:11 +02:00
parent 7f1e7019cb
commit 12cfa6444c
14 changed files with 172 additions and 73 deletions

4
ndp.c
View file

@ -53,7 +53,7 @@ int ndp(struct ctx *c, struct ethhdr *eh, size_t len)
char buf[BUFSIZ] = { 0 };
uint8_t proto, *p;
if (len < sizeof(*ehr) + sizeof(*ip6h) + sizeof(ih))
if (len < sizeof(*ehr) + sizeof(*ip6h) + sizeof(*ih))
return 0;
ih = (struct icmp6hdr *)ipv6_l4hdr(ip6h, &proto);
@ -72,7 +72,7 @@ int ndp(struct ctx *c, struct ethhdr *eh, size_t len)
ihr = (struct icmp6hdr *)(ip6hr + 1);
if (ih->icmp6_type == NS) {
if (len < sizeof(*ehr) + sizeof(*ip6h) + sizeof(ih) +
if (len < sizeof(*ehr) + sizeof(*ip6h) + sizeof(*ih) +
sizeof(struct in6_addr))
return -1;