brcm-2.4: potential fix for pptp nat
[openwrt/svn-archive/archive.git] / target / linux / generic-2.4 / patches / 625-netfilter_nat_pptp_fix.patch
1 --- a/net/ipv4/netfilter/ip_conntrack_pptp.c
2 +++ b/net/ipv4/netfilter/ip_conntrack_pptp.c
3 @@ -134,12 +134,11 @@ static int pptp_expectfn(struct ip_connt
4 }
5
6 /* timeout GRE data connections */
7 -static int pptp_timeout_related(struct ip_conntrack *ct)
8 +static int pptp_timeout_related(struct ip_conntrack *ct, const struct iphdr *iph)
9 {
10 struct list_head *cur_item, *next;
11 struct ip_conntrack_expect *exp;
12 enum ip_conntrack_info ctinfo;
13 - struct iphdr *iph;
14
15 /* FIXME: do we have to lock something ? */
16 for (cur_item = ct->sibling_list.next;
17 @@ -245,7 +244,8 @@ pptp_inbound_pkt(struct tcphdr *tcph,
18 struct pptp_pkt_hdr *pptph,
19 size_t datalen,
20 struct ip_conntrack *ct,
21 - enum ip_conntrack_info ctinfo)
22 + enum ip_conntrack_info ctinfo,
23 + const struct iphdr *iph)
24 {
25 struct PptpControlHeader *ctlh;
26 union pptp_ctrl_union pptpReq;
27 @@ -377,7 +377,7 @@ pptp_inbound_pkt(struct tcphdr *tcph,
28 info->cstate = PPTP_CALL_NONE;
29
30 /* untrack this call id, unexpect GRE packets */
31 - pptp_timeout_related(ct);
32 + pptp_timeout_related(ct, iph);
33 break;
34
35 case PPTP_WAN_ERROR_NOTIFY:
36 @@ -539,7 +539,7 @@ conntrack_pptp_help(const struct iphdr *
37 info->cstate = PPTP_CALL_NONE;
38
39 /* untrack this call id, unexpect GRE packets */
40 - pptp_timeout_related(ct);
41 + pptp_timeout_related(ct, iph);
42 }
43
44
45 @@ -571,7 +571,7 @@ conntrack_pptp_help(const struct iphdr *
46 ret = pptp_outbound_pkt(tcph, pptph, datalen, ct, ctinfo);
47 else
48 /* server -> client (PAC -> PNS) */
49 - ret = pptp_inbound_pkt(tcph, pptph, datalen, ct, ctinfo);
50 + ret = pptp_inbound_pkt(tcph, pptph, datalen, ct, ctinfo, iph);
51 DEBUGP("sstate: %d->%d, cstate: %d->%d\n",
52 oldsstate, info->sstate, oldcstate, info->cstate);
53 UNLOCK_BH(&ip_pptp_lock);