diff options
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 55bedac8..1e3c04c2 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -2055,7 +2055,6 @@ static void ipoe_serv_release(struct ipoe_serv *serv) triton_context_unregister(&serv->ctx); - _free(serv->ifname); _free(serv); } @@ -2218,14 +2217,14 @@ void ipoe_vlan_mon_notify(int ifindex, int vid) return; } - strcpy(ifr.ifr_name, ifname); - len = strlen(ifr.ifr_name); - - if (iplink_vlan_add(ifr.ifr_name, ifindex, vid)) + if (iplink_vlan_add(ifname, ifindex, vid)) return; log_info2("ipoe: create vlan %s parent %s\n", ifname, ifr.ifr_name); + len = strlen(ifname); + memcpy(ifr.ifr_name, ifname, len + 1); + ioctl(sock_fd, SIOCGIFFLAGS, &ifr, sizeof(ifr)); ifr.ifr_flags |= IFF_UP; ioctl(sock_fd, SIOCSIFFLAGS, &ifr, sizeof(ifr)); @@ -2235,6 +2234,7 @@ void ipoe_vlan_mon_notify(int ifindex, int vid) return; } + list_for_each_entry(opt, §->items, entry) { if (strcmp(opt->name, "interface")) continue; @@ -2257,15 +2257,15 @@ void ipoe_vlan_mon_notify(int ifindex, int vid) if (!re) continue; - r = pcre_exec(re, NULL, ifr.ifr_name, len, 0, 0, NULL, 0); + r = pcre_exec(re, NULL, ifname, len, 0, 0, NULL, 0); pcre_free(re); if (r < 0) continue; - add_interface(ifr.ifr_name, ifr.ifr_ifindex, opt->val, ifindex, vid); - } else if (ptr - opt->val == len && memcmp(opt->val, ifr.ifr_name, len) == 0) - add_interface(ifr.ifr_name, ifr.ifr_ifindex, opt->val, ifindex, vid); + add_interface(ifname, ifr.ifr_ifindex, opt->val, ifindex, vid); + } else if (ptr - opt->val == len && memcmp(opt->val, ifname, len) == 0) + add_interface(ifname, ifr.ifr_ifindex, opt->val, ifindex, vid); } } |