From 553b28fd340722154ad8aa92193e288328cee979 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Wed, 9 Mar 2016 16:33:13 +0300 Subject: ipoe: fixed bringing down non-shared interface --- accel-pppd/ctrl/ipoe/ipoe_netlink.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'accel-pppd/ctrl/ipoe/ipoe_netlink.c') diff --git a/accel-pppd/ctrl/ipoe/ipoe_netlink.c b/accel-pppd/ctrl/ipoe/ipoe_netlink.c index 18542cde..d69decbe 100644 --- a/accel-pppd/ctrl/ipoe/ipoe_netlink.c +++ b/accel-pppd/ctrl/ipoe/ipoe_netlink.c @@ -204,6 +204,31 @@ void ipoe_nl_add_interface(int ifindex) log_error("ipoe: nl_add_iface: error talking to kernel\n"); } +void ipoe_nl_del_interface(int ifindex) +{ + struct nlmsghdr *nlh; + struct genlmsghdr *ghdr; + struct { + struct nlmsghdr n; + char buf[1024]; + } req; + + if (rth.fd == -1) + return; + + nlh = &req.n; + nlh->nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); + nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; + nlh->nlmsg_type = ipoe_genl_id; + + ghdr = NLMSG_DATA(&req.n); + ghdr->cmd = IPOE_CMD_DEL_IF; + + addattr32(nlh, 1024, IPOE_ATTR_IFINDEX, ifindex); + + if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 ) + log_error("ipoe: nl_del_iface: error talking to kernel\n"); +} int ipoe_nl_create(uint32_t peer_addr, uint32_t addr, const char *ifname, uint8_t *hwaddr) { -- cgit v1.2.3