From d901be9d685671a751ba1bfd40cffd73961a0d77 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Wed, 9 Mar 2016 20:20:20 +0300 Subject: ipoe: fixed local-net with /32 mask --- accel-pppd/ctrl/ipoe/ipoe_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel-pppd/ctrl/ipoe/ipoe_netlink.c b/accel-pppd/ctrl/ipoe/ipoe_netlink.c index d69decb..fa7b0a2 100644 --- a/accel-pppd/ctrl/ipoe/ipoe_netlink.c +++ b/accel-pppd/ctrl/ipoe/ipoe_netlink.c @@ -75,7 +75,7 @@ void ipoe_nl_add_net(uint32_t addr, int mask) ghdr = NLMSG_DATA(&req.n); ghdr->cmd = IPOE_CMD_ADD_NET; - mask = ((1 << mask) - 1) << (32 - mask); + mask = mask ? ~0 << (32 - mask) : 0; addattr32(nlh, 1024, IPOE_ATTR_ADDR, addr); addattr32(nlh, 1024, IPOE_ATTR_MASK, mask); -- cgit v1.2.3