aboutgitcodebugslistschat
path: root/passt.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-04-21 17:19:11 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-04-21 17:19:11 +0200
commitad60ab1b378da41ba230319eb0e71e3101207a39 (patch)
tree20c0cb9d747bb4dff1c2492e8356e5f5e1a75e93 /passt.c
parentfaff1336296741ab434ae33b948cffe57a51886d (diff)
downloadpasst-ad60ab1b378da41ba230319eb0e71e3101207a39.tar
passt-ad60ab1b378da41ba230319eb0e71e3101207a39.tar.gz
passt-ad60ab1b378da41ba230319eb0e71e3101207a39.tar.bz2
passt-ad60ab1b378da41ba230319eb0e71e3101207a39.tar.lz
passt-ad60ab1b378da41ba230319eb0e71e3101207a39.tar.xz
passt-ad60ab1b378da41ba230319eb0e71e3101207a39.tar.zst
passt-ad60ab1b378da41ba230319eb0e71e3101207a39.zip
passt: Always use INET_ADDRSTRLEN/INET6_ADDRSTRLEN for inet_ntop() buffers
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'passt.c')
-rw-r--r--passt.c8
1 files changed, 4 insertions, 4 deletions
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;