summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c7
-rw-r--r--drivers/ipoe/ipoe.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 214f93a..aae1cd1 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);
diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index 54cb217..6fe13f8 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -155,7 +155,7 @@ static int ipoe_check_network(__be32 addr)
rcu_read_lock();
list_for_each_entry_rcu(n, &ipoe_networks, entry) {
- if ((addr & n->mask) == n->addr) {
+ if ((ntohl(addr) & n->mask) == n->addr) {
r = 1;
break;
}