diff options
Diffstat (limited to 'accel-pppd/ctrl/ipoe/ipoe.c')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 214f93a9..aae1cd10 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -1627,7 +1627,12 @@ static void parse_local_net(const char *opt) if (mask == 32) mask = 0xffffffff; else - mask = (1 << mask) - 1; + mask = (1 << (32-mask)) - 1; + + addr = ntohl(addr); + mask = ~mask; + + //printf("%x/%x %x\n", htonl(addr), ~mask, htonl(addr)&(~mask)); ipoe_nl_add_net(addr & mask, mask); |