diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2016-03-14 15:57:47 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2016-03-14 15:57:47 +0300 |
commit | ea7f988b40c03a21571143be30200f77450f3ba4 (patch) | |
tree | b6d219156330b194c8ad5bac37ae9c47361a13d8 | |
parent | 2540699e50c7a4d46968c4ebcb3aa61f056d3518 (diff) | |
download | accel-ppp-ea7f988b40c03a21571143be30200f77450f3ba4.tar.gz accel-ppp-ea7f988b40c03a21571143be30200f77450f3ba4.zip |
ipoe: bug fixes
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 18 | ||||
-rw-r--r-- | drivers/ipoe/ipoe.c | 2 |
2 files changed, 10 insertions, 10 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); } } diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c index edf26cda..c8048dc2 100644 --- a/drivers/ipoe/ipoe.c +++ b/drivers/ipoe/ipoe.c @@ -1450,7 +1450,7 @@ static int ipoe_nl_cmd_del_interface(struct sk_buff *skb, struct genl_info *info kfree_rcu(i, rcu_head); - if (ifindex == -1) + if (ifindex != -1) break; } } |