aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-11-06 03:32:52 +0900
committerHarald Welte <laforge@gnumonks.org>2017-11-06 03:32:52 +0900
commit1af543f44c79696abdd422a3e28458f8deb11375 (patch)
treed9c177503878db60c443e09c116ffec81ca2253c
parentbd228244da492df768f6c8d2a0032846f1dde4fa (diff)
tun: Don't copy 16byte IPv6 address to 'struct in_addr'
The 'struct tun' curently only has an in_addr (v4-only) member to store the address of the tun device, so let's not attempt to store an IPv6 address in it. FIXME: This entire code needs an overhaul. The assumption that there's only one address, and only either v6 or v4 is broken to begin with. Change-Id: If0b626d688841d6e0a3867834f4cb1b70084050e Fixes: Coverity CID#174278
-rw-r--r--lib/tun.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/tun.c b/lib/tun.c
index 6bcc13b..3c293a2 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -396,7 +396,6 @@ static int tun_setaddr6(struct tun_t *this, struct in6_addr *addr, struct in6_ad
#if defined(__linux__)
if (addr) {
- memcpy(&this->addr, addr, sizeof(*addr));
memcpy(&ifr.ifr6_addr, addr, sizeof(*addr));
if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) {
if (errno != EEXIST) {