diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2016-03-17 22:24:19 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2016-03-17 22:24:26 +0300 |
commit | cc9e2a49061b2a77a51e27ed23c8040626a2083b (patch) | |
tree | a906d60e21d789d9d7a88825ada70be0622ecca4 /accel-pppd/vlan-mon | |
parent | ea7f988b40c03a21571143be30200f77450f3ba4 (diff) | |
download | accel-ppp-cc9e2a49061b2a77a51e27ed23c8040626a2083b.tar.gz accel-ppp-cc9e2a49061b2a77a51e27ed23c8040626a2083b.zip |
vlan_mon,ipoe,pppoe: implemented detection of vlan existance
Diffstat (limited to 'accel-pppd/vlan-mon')
-rw-r--r-- | accel-pppd/vlan-mon/vlan_mon.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/accel-pppd/vlan-mon/vlan_mon.c b/accel-pppd/vlan-mon/vlan_mon.c index 7f15aa06..9b77fbc6 100644 --- a/accel-pppd/vlan-mon/vlan_mon.c +++ b/accel-pppd/vlan-mon/vlan_mon.c @@ -151,7 +151,7 @@ static void vlan_mon_handler(const struct sockaddr_nl *addr, struct nlmsghdr *h) int len = h->nlmsg_len; struct rtattr *attrs; int i; - int ifindex, vid, proto; + int ifindex, vid, proto, vlan_ifindex; len -= NLMSG_LENGTH(GENL_HDRLEN); @@ -176,7 +176,12 @@ static void vlan_mon_handler(const struct sockaddr_nl *addr, struct nlmsghdr *h) vid = *(uint32_t *)(RTA_DATA(tb2[VLAN_MON_ATTR_VID])); proto = *(uint32_t *)(RTA_DATA(tb2[VLAN_MON_ATTR_PROTO])); - log_debug("vlan-mon: notify %i %i %04x\n", ifindex, vid, proto); + if (tb2[VLAN_MON_ATTR_VLAN_IFINDEX]) + vlan_ifindex = *(uint32_t *)(RTA_DATA(tb2[VLAN_MON_ATTR_VLAN_IFINDEX])); + else + vlan_ifindex = 0; + + log_debug("vlan-mon: notify %i %i %04x %i\n", ifindex, vid, proto, vlan_ifindex); if (proto == ETH_P_PPP_DISC) proto = 1; @@ -184,7 +189,7 @@ static void vlan_mon_handler(const struct sockaddr_nl *addr, struct nlmsghdr *h) proto = 0; if (cb[proto]) - cb[proto](ifindex, vid); + cb[proto](ifindex, vid, vlan_ifindex); } } |