From 29e80de7214199500b56e4ac3a667a40df1a7f20 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Tue, 4 Apr 2017 12:44:16 +0300 Subject: ipoe: included lua bitop library Included bitop library http://bitop.luajit.org/index.html It may be used to extract vlan components in username function: function username(ses) vid=ses:vlan() svid=bit.rshift(vid,16) cvid=bit.band(vid,0xffff) ... end --- accel-pppd/ctrl/ipoe/ipoe.c | 1 + 1 file changed, 1 insertion(+) (limited to 'accel-pppd/ctrl/ipoe/ipoe.c') diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 62c06f0f..b8aba6c9 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -2893,6 +2893,7 @@ static void add_interface(const char *ifname, int ifindex, const char *opt, int serv->opt_lua_username_func = opt_lua_username_func; #endif serv->parent_ifindex = parent_ifindex; + serv->parent_vid = parent_ifindex ? iplink_vlan_get_vid(parent_ifindex, NULL) : 0; serv->vid = vid; serv->active = 1; INIT_LIST_HEAD(&serv->sessions); -- cgit v1.2.3