summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-08-10 10:36:44 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-08-10 10:36:44 +0400
commitacacb1907f3f24589763abebcf4546949d0cccc5 (patch)
treeb437c16b823bf7e80ae24da082c32ea438cc155f
parent735e6f1e66f3aa9a5eeaa851923517a1907039fb (diff)
downloadaccel-ppp-acacb1907f3f24589763abebcf4546949d0cccc5.tar.gz
accel-ppp-acacb1907f3f24589763abebcf4546949d0cccc5.zip
ipoe: fixed packet receive path
-rw-r--r--drivers/ipoe/ipoe.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index c2c9b344..9db9d8c1 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -294,14 +294,14 @@ static int ipoe_route4(struct sk_buff *skb)
struct net *net = pick_net(skb);
struct rtable *rt;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,38)
struct flowi fl4;
#else
struct flowi4 fl4;
#endif
memset(&fl4, 0, sizeof(fl4));
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,38)
fl4.fl4_dst = iph->daddr;
fl4.fl4_tos = RT_TOS(iph->tos);
fl4.fl4_scope = RT_SCOPE_UNIVERSE;
@@ -644,7 +644,7 @@ static unsigned int ipt_in_hook(unsigned int hook, struct sk_buff *skb, const st
struct sk_buff *skb1;
unsigned char *cb_ptr;
struct net_device_stats *stats;
- int ret = NF_ACCEPT;
+ int ret = NF_DROP;
if (skb->protocol != htons(ETH_P_IP))
return NF_ACCEPT;
@@ -664,10 +664,11 @@ static unsigned int ipt_in_hook(unsigned int hook, struct sk_buff *skb, const st
if (!iph->saddr)
return NF_ACCEPT;
- //pr_info("ipoe: recv %08x %08x\n", iph->saddr, iph->daddr);
if (!ipoe_check_network(iph->saddr))
return NF_ACCEPT;
+ //pr_info("ipoe: recv %08x %08x\n", iph->saddr, iph->daddr);
+
ses = ipoe_lookup(iph->saddr);
if (!ses) {
@@ -682,27 +683,28 @@ static unsigned int ipt_in_hook(unsigned int hook, struct sk_buff *skb, const st
eth = eth_hdr(skb);
if (memcmp(eth->h_source, ses->hwaddr, ETH_ALEN)) {
stats->rx_dropped++;
- ret = NF_DROP;
goto out;
}
}
- if (skb->dev == ses->dev)
+ if (skb->dev == ses->dev) {
+ ret = NF_ACCEPT;
goto out;
+ }
- if (ses->addr && ipoe_check_network(iph->daddr))
+ if (ses->addr && ipoe_check_network(iph->daddr)) {
+ ret = NF_ACCEPT;
goto out;
+ }
skb1 = skb_clone(skb, GFP_ATOMIC);
if (!skb1) {
stats->rx_dropped++;
- ret = NF_DROP;
goto out;
}
if (ses->addr > 1 && ipoe_do_nat(skb1, ses->addr, 0)) {
kfree_skb(skb1);
- ret = NF_DROP;
goto out;
}