From: Steven Barth Date: Sat, 27 Sep 2014 16:54:43 +0000 (+0200) Subject: Send RS alternatingly with and without source MAC X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3e52a1448eee0fbf7ff67c123265bedcbc9c26d0;p=oweals%2Fodhcp6c.git Send RS alternatingly with and without source MAC --- diff --git a/src/ra.c b/src/ra.c index b700c9a..baaee9b 100644 --- a/src/ra.c +++ b/src/ra.c @@ -146,7 +146,7 @@ static void ra_send_rs(int signal __attribute__((unused))) struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, if_name, sizeof(ifr.ifr_name)); - if (!ioctl(sock, SIOCGIFHWADDR, &ifr) + if ((rs_attempt % 2 == 0) && !ioctl(sock, SIOCGIFHWADDR, &ifr) && memcmp(rs.lladdr.data, ifr.ifr_hwaddr.sa_data, 6)) memcpy(rs.lladdr.data, ifr.ifr_hwaddr.sa_data, 6); else