projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb3c1b8
)
Get MAC of TAP device.
author
Borg
<borg@uu3.net>
Sat, 28 Jun 2014 12:33:07 +0000
(14:33 +0200)
committer
Guus Sliepen
<guus@sliepen.org>
Sat, 28 Jun 2014 20:19:04 +0000
(21:19 +0100)
This fixes initial communication problems since
mymac is NOT properly initialized.
src/linux/device.c
patch
|
blob
|
history
diff --git
a/src/linux/device.c
b/src/linux/device.c
index 66e790a5b8fc3cce80f762dfe6c2d2ae8652e23b..8d042d21f3e77fcd4cdcb639057cfe86c32f6bef 100644
(file)
--- 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;