mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-26 16:31:11 +00:00
Avoid an all-zero Ethernet/MAC address when using TUN/TAP (fixes #154).
Previously, when "ether tun" configuration was used on a Linux host, packets were sent with Ethernet/MAC address 00:00:00:00:00:00. Under CentOS 7 at least, this did not appear to cause any issues where the tun interface on the host was configured with an IP address, but when an attempt was made to bridge the tun interface, it was no longer possible to establish IP communication between the emulated machine and either the Linux host or a Windows NT Server 4 VM. This fix causes an Ethernet/MAC address to be generated in the same way when using TUN/TAP as is done for ethertap.
This commit is contained in:
parent
1c9b21f580
commit
385b49ba8e
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user