Merge pull request #157 from dcoshea/issue-154

Avoid an all-zero Ethernet/MAC address when using TUN/TAP (fixes #154).
This commit is contained in:
asvitkine 2017-12-28 13:31:41 -05:00 committed by GitHub
commit 461332cbf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -371,7 +371,7 @@ bool ether_init(void)
#endif
// Get Ethernet address
if (net_if_type == NET_IF_ETHERTAP) {
if (net_if_type == NET_IF_ETHERTAP || net_if_type == NET_IF_TUNTAP) {
pid_t p = getpid(); // If configured for multicast, ethertap requires that the lower 32 bit of the Ethernet address are our PID
ether_addr[0] = 0xfe;
ether_addr[1] = 0xfd;