--- libelwix/src/net.c 2016/05/14 19:55:52 1.12.4.4 +++ libelwix/src/net.c 2016/05/14 20:02:04 1.12.4.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: net.c,v 1.12.4.4 2016/05/14 19:55:52 misho Exp $ +* $Id: net.c,v 1.12.4.5 2016/05/14 20:02:04 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -529,6 +529,15 @@ e_ether_addr(const char *ifname, ether_addr_t * __rest a = e_malloc(sizeof(ether_addr_t)); if (a) memcpy(a, req.ifr_addr.sa_data, sizeof(ether_addr_t)); + + /* should set mac address */ + if (addr) { + memset(&req, 0, sizeof req); + strlcpy(req.ifr_name, ifname, sizeof req.ifr_name); + /* TODO: sa */ + req.ifr_ifru.ifru_addr = sa.sa; + ioctl(s, SIOCSIFLLADDR, &req); + } } close(s); break;