[NETFILTER]: PPTP conntrack: check call ID before changing state
For rejected calls the state is set to PPTP_CALL_NONE even for non-matching call ids. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
87a0117afd
commit
750a584233
@@ -335,25 +335,19 @@ pptp_inbound_pkt(struct sk_buff **pskb,
|
|||||||
info->cstate != PPTP_CALL_OUT_CONF)
|
info->cstate != PPTP_CALL_OUT_CONF)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
if (pptpReq->ocack.resultCode != PPTP_OUTCALL_CONNECT) {
|
|
||||||
info->cstate = PPTP_CALL_NONE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
cid = pptpReq->ocack.callID;
|
cid = pptpReq->ocack.callID;
|
||||||
pcid = pptpReq->ocack.peersCallID;
|
pcid = pptpReq->ocack.peersCallID;
|
||||||
|
|
||||||
info->pac_call_id = cid;
|
|
||||||
|
|
||||||
if (info->pns_call_id != pcid)
|
if (info->pns_call_id != pcid)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
DEBUGP("%s, CID=%X, PCID=%X\n", pptp_msg_name[msg],
|
DEBUGP("%s, CID=%X, PCID=%X\n", pptp_msg_name[msg],
|
||||||
ntohs(cid), ntohs(pcid));
|
ntohs(cid), ntohs(pcid));
|
||||||
|
|
||||||
info->cstate = PPTP_CALL_OUT_CONF;
|
if (pptpReq->ocack.resultCode == PPTP_OUTCALL_CONNECT) {
|
||||||
|
info->cstate = PPTP_CALL_OUT_CONF;
|
||||||
exp_gre(ct, cid, pcid);
|
info->pac_call_id = cid;
|
||||||
|
exp_gre(ct, cid, pcid);
|
||||||
|
} else
|
||||||
|
info->cstate = PPTP_CALL_NONE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPTP_IN_CALL_REQUEST:
|
case PPTP_IN_CALL_REQUEST:
|
||||||
@@ -464,17 +458,17 @@ pptp_outbound_pkt(struct sk_buff **pskb,
|
|||||||
info->cstate != PPTP_CALL_IN_REP)
|
info->cstate != PPTP_CALL_IN_REP)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
if (pptpReq->icack.resultCode != PPTP_INCALL_ACCEPT) {
|
|
||||||
info->cstate = PPTP_CALL_NONE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
pcid = pptpReq->icack.peersCallID;
|
pcid = pptpReq->icack.peersCallID;
|
||||||
if (info->pac_call_id != pcid)
|
if (info->pac_call_id != pcid)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
DEBUGP("%s, CID=%X\n", pptp_msg_name[msg], ntohs(pcid));
|
DEBUGP("%s, CID=%X\n", pptp_msg_name[msg], ntohs(pcid));
|
||||||
/* part two of the three-way handshake */
|
|
||||||
info->cstate = PPTP_CALL_IN_REP;
|
if (pptpReq->icack.resultCode == PPTP_INCALL_ACCEPT) {
|
||||||
info->pns_call_id = pcid;
|
/* part two of the three-way handshake */
|
||||||
|
info->cstate = PPTP_CALL_IN_REP;
|
||||||
|
info->pns_call_id = pcid;
|
||||||
|
} else
|
||||||
|
info->cstate = PPTP_CALL_NONE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPTP_CALL_CLEAR_REQUEST:
|
case PPTP_CALL_CLEAR_REQUEST:
|
||||||
|
Reference in New Issue
Block a user