From 54c6736341bda9564a028ad3d61d46488e53b8a6 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Sat, 5 Nov 2016 18:41:13 +0100 Subject: eth-multiplexer: Generate stable ethernet addresses. Previously, the ethernet multiplexer generated ethernet addresses for the virtual interfaces using a pseudo-random number generator. This has the downside of generating a new address every time. Generate stable pseudo-random addresses instead. * eth-multiplexer/Makefile (HURDLIBS): Link to libihash. * eth-multiplexer/ethernet.c (ether_address): New variable. (get_ethernet_address): New function. (ethernet_open): Get the ethernet address of the real interface. * eth-multiplexer/ethernet.h (ether_address): New declaration. * eth-multiplexer/vdev.c (add_vdev): Compute the ethernet address by hashing the address of the real interface with the name of the virtual interface. --- eth-multiplexer/ethernet.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'eth-multiplexer/ethernet.h') diff --git a/eth-multiplexer/ethernet.h b/eth-multiplexer/ethernet.h index 8efab9b1..a2b2f5ee 100644 --- a/eth-multiplexer/ethernet.h +++ b/eth-multiplexer/ethernet.h @@ -23,10 +23,12 @@ #ifndef ETHERNET_H #define ETHERNET_H +#include +#include #include -#include extern mach_port_t ether_port; +extern char ether_address[ETH_ALEN]; int ethernet_open (char *dev_name, device_t master_device, struct port_bucket *etherport_bucket, -- cgit v1.2.3