summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-03-09 20:20:20 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-03-09 20:20:20 +0300
commitd901be9d685671a751ba1bfd40cffd73961a0d77 (patch)
tree639301113a1c11d28f97e0c45cd49394872594a5 /accel-pppd/ctrl
parent14780ff57d994a324de6e7de888381358ec7238f (diff)
downloadaccel-ppp-d901be9d685671a751ba1bfd40cffd73961a0d77.tar.gz
accel-ppp-d901be9d685671a751ba1bfd40cffd73961a0d77.zip
ipoe: fixed local-net with /32 mask
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe_netlink.c2
1 files changed, 1 insertions, 1 deletions
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);