From ad60ab1b378da41ba230319eb0e71e3101207a39 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 21 Apr 2021 17:19:11 +0200 Subject: passt: Always use INET_ADDRSTRLEN/INET6_ADDRSTRLEN for inet_ntop() buffers Signed-off-by: Stefano Brivio --- passt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'passt.c') diff --git a/passt.c b/passt.c index 2fe57bc..c9822d3 100644 --- a/passt.c +++ b/passt.c @@ -308,10 +308,10 @@ static void get_dns(struct ctx *c) */ static void tap4_handler(struct ctx *c, char *in, size_t len) { + char buf_s[INET_ADDRSTRLEN] __attribute((__unused__)); + char buf_d[INET_ADDRSTRLEN] __attribute((__unused__)); struct ethhdr *eh = (struct ethhdr *)in; struct iphdr *iph = (struct iphdr *)(eh + 1); - char buf_s[BUFSIZ] __attribute((__unused__)); - char buf_d[BUFSIZ] __attribute((__unused__)); char *l4h; if (!c->v4) @@ -360,10 +360,10 @@ static void tap4_handler(struct ctx *c, char *in, size_t len) */ static void tap6_handler(struct ctx *c, char *in, size_t len) { + char buf_s[INET6_ADDRSTRLEN] __attribute((__unused__)); + char buf_d[INET6_ADDRSTRLEN] __attribute((__unused__)); struct ethhdr *eh = (struct ethhdr *)in; struct ipv6hdr *ip6h = (struct ipv6hdr *)(eh + 1); - char buf_s[BUFSIZ] __attribute((__unused__)); - char buf_d[BUFSIZ] __attribute((__unused__)); uint8_t proto; char *l4h; -- cgit v1.2.3