diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-06-27 23:24:28 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-06-27 23:24:28 +0400 |
commit | d2b65bb7c8f0e6689682daadd47770c5c40cd85d (patch) | |
tree | 9a3126c1db2b44385a0af717698515d3f7c4b0b2 /accel-pppd/ctrl | |
parent | e2ca2a98a2708d8d03dd243d4819469c711a5d91 (diff) | |
download | accel-ppp-d2b65bb7c8f0e6689682daadd47770c5c40cd85d.tar.gz accel-ppp-d2b65bb7c8f0e6689682daadd47770c5c40cd85d.zip |
ipoe: improved vlan monitor
Previous version used linear list of vlan monitor enabled interfaces,
this caused huge overhead in packet receive path because for each
received packet it performed search on linear list to check if vlan monitor
is enabled on input device.
Current version binds internal structure to net_device->ml_priv so search is not performed more.
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 9a21c8c..039a66a 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -1967,17 +1967,21 @@ void ipoe_vlan_notify(int ifindex, int vid) log_error("ipoe: vlan-mon: %s.%i: interface name is too long\n", ifr.ifr_name, vid); return; } + + log_info2("ipoe: create vlan %s parent %s\n", ifname, ifr.ifr_name); strcpy(ifr.ifr_name, ifname); len = strlen(ifr.ifr_name); - log_info2("ipoe: create vlan %s parent %s\n", ifr.ifr_name, ifname); - if (iplink_vlan_add(ifr.ifr_name, ifindex, vid)) { log_warn("ipoe: vlan-mon: %s: failed to add vlan\n", ifr.ifr_name); return; } + ioctl(sock_fd, SIOCGIFFLAGS, &ifr, sizeof(ifr)); + ifr.ifr_flags |= IFF_UP; + ioctl(sock_fd, SIOCSIFFLAGS, &ifr, sizeof(ifr)); + if (ioctl(sock_fd, SIOCGIFINDEX, &ifr, sizeof(ifr))) { log_error("ipoe: vlan-mon: %s: failed to get interface index\n", ifr.ifr_name); return; |