From 3f4beaca9bcea35ffeff810f068487dd449cc2cb Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Thu, 17 Mar 2016 16:27:50 +0300 Subject: ipoe: log warn if interface was not started by vlan_mon notification --- accel-pppd/ctrl/ipoe/ipoe.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'accel-pppd/ctrl') diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 1e3c04c2..9d3890d5 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -2217,11 +2217,11 @@ void ipoe_vlan_mon_notify(int ifindex, int vid) return; } + log_info2("ipoe: create vlan %s parent %s\n", ifname, ifr.ifr_name); + 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); @@ -2234,7 +2234,6 @@ void ipoe_vlan_mon_notify(int ifindex, int vid) return; } - list_for_each_entry(opt, §->items, entry) { if (strcmp(opt->name, "interface")) continue; @@ -2264,9 +2263,14 @@ void ipoe_vlan_mon_notify(int ifindex, int vid) continue; add_interface(ifname, ifr.ifr_ifindex, opt->val, ifindex, vid); - } else if (ptr - opt->val == len && memcmp(opt->val, ifname, len) == 0) + return; + } else if (ptr - opt->val == len && memcmp(opt->val, ifname, len) == 0) { add_interface(ifname, ifr.ifr_ifindex, opt->val, ifindex, vid); + return; + } } + + log_warn("ipoe: vlan %s not started\n", ifname); } static void ipoe_serv_timeout(struct triton_timer_t *t) -- cgit v1.2.3