summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/ipoe
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-06-08 21:15:54 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-06-08 21:15:54 +0300
commit00015eb051babde040ec30e3b867f49b7d4e5441 (patch)
tree6e1255f0afa0c2d6a37680b8733301f0150db405 /accel-pppd/ctrl/ipoe
parent7fe9078e44b13c030e4c9ca55cc431f2811efc5a (diff)
downloadaccel-ppp-00015eb051babde040ec30e3b867f49b7d4e5441.tar.gz
accel-ppp-00015eb051babde040ec30e3b867f49b7d4e5441.zip
ipoe: fixed incorrect initialization of interface's hwaddr in internal structure
Diffstat (limited to 'accel-pppd/ctrl/ipoe')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index e4c1fae..b3e2ba2 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -2462,6 +2462,7 @@ static void add_interface(const char *ifname, int ifindex, const char *opt, int
in_addr_t opt_src = conf_src;
int opt_arp = conf_arp;
struct ifreq ifr;
+ uint8_t hwaddr[ETH_ALEN];
str0 = strchr(opt, ',');
if (str0) {
@@ -2660,6 +2661,8 @@ static void add_interface(const char *ifname, int ifindex, const char *opt, int
return;
}
+ memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, ETH_ALEN);
+
ioctl(sock_fd, SIOCGIFFLAGS, &ifr);
if ((ifr.ifr_flags & IFF_UP) && opt_shared == 0) {
@@ -2707,7 +2710,7 @@ static void add_interface(const char *ifname, int ifindex, const char *opt, int
INIT_LIST_HEAD(&serv->sessions);
INIT_LIST_HEAD(&serv->disc_list);
INIT_LIST_HEAD(&serv->req_list);
- memcpy(serv->hwaddr, ifr.ifr_hwaddr.sa_data, ETH_ALEN);
+ memcpy(serv->hwaddr, hwaddr, ETH_ALEN);
serv->disc_timer.expire = ipoe_serv_disc_timer;
triton_context_register(&serv->ctx, NULL);