summaryrefslogtreecommitdiff
path: root/curvetun.h
diff options
context:
space:
mode:
authorMatPerin <matteoperin1302@gmail.com>2022-04-14 22:15:07 -0400
committerTobias Klauser <tobias.klauser@gmail.com>2022-04-22 11:20:09 +0200
commitb23c1519f14a2c93f7927996844522e3caede79c (patch)
tree438a08989277c943cc3abba6223f4afc116cae14 /curvetun.h
parentf0187ac5c6b9ee8d600521a88e4c8a482744171c (diff)
trafgen: Check pointer in ipv6 device address lookup function
The getifaddrs function returns a linked list node for L2 even in the case of L3 interfaces (e.g. a TUN device), but with the pointer to the address structure set to NULL. This causes a segfault when trying to access the address family from it when such network interfaces are present in the system. The issue is solved by checking the validity of the pointer beforehand: if the address structure is present the address family can be fetched and the current iteration can go on safely, otherwise the node is skipped (as it is not linked to any address). Signed-off-by: Matteo Perin <matteoperin1302@gmail.com>
Diffstat (limited to 'curvetun.h')
0 files changed, 0 insertions, 0 deletions