aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-09-20 15:10:52 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 18:20:18 -0400
commit62fbe9c82b20197a4f9c54f7add5d368418ba277 (patch)
tree8dac2b3d2e0fe0bced40b4c12656070023eb4ac2 /net
parent750a58423309b56751076329e9edf61b93213e0f (diff)
[NETFILTER]: PPTP conntrack: fix PPTP_IN_CALL message types
Fix incorrectly used message types and call IDs: - PPTP_IN_CALL_REQUEST (PAC->PNS) contains a PptpInCallRequest (icreq) message and the PAC call ID - PPTP_IN_CALL_REPLY (PNS->PAC) contains a PptpInCallReply (icack) message and the PNS call ID Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/netfilter/ip_conntrack_helper_pptp.c12
-rw-r--r--net/ipv4/netfilter/ip_nat_helper_pptp.c2
2 files changed, 8 insertions, 6 deletions
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
index 5cb6b61cd171..b0225b65ca35 100644
--- a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
+++ b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
@@ -355,10 +355,10 @@ pptp_inbound_pkt(struct sk_buff **pskb,
355 if (info->sstate != PPTP_SESSION_CONFIRMED) 355 if (info->sstate != PPTP_SESSION_CONFIRMED)
356 goto invalid; 356 goto invalid;
357 357
358 pcid = pptpReq->icack.peersCallID; 358 cid = pptpReq->icreq.callID;
359 DEBUGP("%s, PCID=%X\n", pptp_msg_name[msg], ntohs(pcid)); 359 DEBUGP("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
360 info->cstate = PPTP_CALL_IN_REQ; 360 info->cstate = PPTP_CALL_IN_REQ;
361 info->pac_call_id = pcid; 361 info->pac_call_id = cid;
362 break; 362 break;
363 363
364 case PPTP_IN_CALL_CONNECT: 364 case PPTP_IN_CALL_CONNECT:
@@ -458,15 +458,17 @@ pptp_outbound_pkt(struct sk_buff **pskb,
458 info->cstate != PPTP_CALL_IN_REP) 458 info->cstate != PPTP_CALL_IN_REP)
459 goto invalid; 459 goto invalid;
460 460
461 cid = pptpReq->icack.callID;
461 pcid = pptpReq->icack.peersCallID; 462 pcid = pptpReq->icack.peersCallID;
462 if (info->pac_call_id != pcid) 463 if (info->pac_call_id != pcid)
463 goto invalid; 464 goto invalid;
464 DEBUGP("%s, CID=%X\n", pptp_msg_name[msg], ntohs(pcid)); 465 DEBUGP("%s, CID=%X PCID=%X\n", pptp_msg_name[msg],
466 ntohs(cid), ntohs(pcid));
465 467
466 if (pptpReq->icack.resultCode == PPTP_INCALL_ACCEPT) { 468 if (pptpReq->icack.resultCode == PPTP_INCALL_ACCEPT) {
467 /* part two of the three-way handshake */ 469 /* part two of the three-way handshake */
468 info->cstate = PPTP_CALL_IN_REP; 470 info->cstate = PPTP_CALL_IN_REP;
469 info->pns_call_id = pcid; 471 info->pns_call_id = cid;
470 } else 472 } else
471 info->cstate = PPTP_CALL_NONE; 473 info->cstate = PPTP_CALL_NONE;
472 break; 474 break;
diff --git a/net/ipv4/netfilter/ip_nat_helper_pptp.c b/net/ipv4/netfilter/ip_nat_helper_pptp.c
index 84f6bd09fcd4..2ff578807123 100644
--- a/net/ipv4/netfilter/ip_nat_helper_pptp.c
+++ b/net/ipv4/netfilter/ip_nat_helper_pptp.c
@@ -172,7 +172,7 @@ pptp_outbound_pkt(struct sk_buff **pskb,
172 ct_pptp_info->pns_call_id = new_callid; 172 ct_pptp_info->pns_call_id = new_callid;
173 break; 173 break;
174 case PPTP_IN_CALL_REPLY: 174 case PPTP_IN_CALL_REPLY:
175 cid_off = offsetof(union pptp_ctrl_union, icreq.callID); 175 cid_off = offsetof(union pptp_ctrl_union, icack.callID);
176 break; 176 break;
177 case PPTP_CALL_CLEAR_REQUEST: 177 case PPTP_CALL_CLEAR_REQUEST:
178 cid_off = offsetof(union pptp_ctrl_union, clrreq.callID); 178 cid_off = offsetof(union pptp_ctrl_union, clrreq.callID);