From: Borg Date: Sat, 28 Jun 2014 12:33:07 +0000 (+0200) Subject: Get MAC of TAP device. X-Git-Tag: release-1.0.25~9 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=16974ec1726d93508bdfa7a6046d4795510f981a;p=tinc Get MAC of TAP device. This fixes initial communication problems since mymac is NOT properly initialized. --- diff --git a/src/linux/device.c b/src/linux/device.c index 66e790a5..8d042d21 100644 --- a/src/linux/device.c +++ b/src/linux/device.c @@ -134,6 +134,9 @@ static bool setup_device(void) { iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device); } + if(overwrite_mac && !ioctl(device_fd, SIOCGIFHWADDR, &ifr)) + memcpy(mymac.x, ifr.ifr_hwaddr.sa_data, ETH_ALEN); + logger(LOG_INFO, "%s is a %s", device, device_info); return true;