Use SIOCGIFADDR on BSDs that support it.
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 9 Apr 2016 16:40:09 +0000 (18:40 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 9 Apr 2016 16:40:09 +0000 (18:40 +0200)
src/bsd/device.c

index 70e0b0b12fee0646dced9a624a0d98e6d2ed500f..653076b15dc475d4ff27c6e1c2afbc7d52e498ca 100644 (file)
@@ -203,6 +203,11 @@ static bool setup_device(void) {
 #endif
        }
 
+#ifdef SIOCGIFADDR
+       if(overwrite_mac)
+               ioctl(device_fd, SIOCGIFADDR, mymac.x);
+#endif
+
        logger(LOG_INFO, "%s is a %s", device, device_info);
 
        return true;