[NETFILTER]: PPTP conntrack: remove unnecessary cid/pcid header pointers
Just the values are needed, not the memory locations. 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
6013c0a13e
commit
857c06da2b
@@ -334,7 +334,7 @@ pptp_inbound_pkt(struct sk_buff **pskb,
|
|||||||
union pptp_ctrl_union _pptpReq, *pptpReq;
|
union pptp_ctrl_union _pptpReq, *pptpReq;
|
||||||
struct ip_ct_pptp_master *info = &ct->help.ct_pptp_info;
|
struct ip_ct_pptp_master *info = &ct->help.ct_pptp_info;
|
||||||
u_int16_t msg;
|
u_int16_t msg;
|
||||||
__be16 *cid, *pcid;
|
__be16 cid, pcid;
|
||||||
|
|
||||||
ctlh = skb_header_pointer(*pskb, nexthdr_off, sizeof(_ctlh), &_ctlh);
|
ctlh = skb_header_pointer(*pskb, nexthdr_off, sizeof(_ctlh), &_ctlh);
|
||||||
if (!ctlh) {
|
if (!ctlh) {
|
||||||
@@ -414,23 +414,23 @@ pptp_inbound_pkt(struct sk_buff **pskb,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cid = &pptpReq->ocack.callID;
|
cid = pptpReq->ocack.callID;
|
||||||
pcid = &pptpReq->ocack.peersCallID;
|
pcid = pptpReq->ocack.peersCallID;
|
||||||
|
|
||||||
info->pac_call_id = *cid;
|
info->pac_call_id = cid;
|
||||||
|
|
||||||
if (info->pns_call_id != *pcid) {
|
if (info->pns_call_id != pcid) {
|
||||||
DEBUGP("%s for unknown callid %u\n",
|
DEBUGP("%s for unknown callid %u\n",
|
||||||
pptp_msg_name[msg], ntohs(*pcid));
|
pptp_msg_name[msg], ntohs(pcid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
info->cstate = PPTP_CALL_OUT_CONF;
|
||||||
|
|
||||||
exp_gre(ct, *cid, *pcid);
|
exp_gre(ct, cid, pcid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPTP_IN_CALL_REQUEST:
|
case PPTP_IN_CALL_REQUEST:
|
||||||
@@ -444,10 +444,10 @@ pptp_inbound_pkt(struct sk_buff **pskb,
|
|||||||
DEBUGP("%s but no session\n", pptp_msg_name[msg]);
|
DEBUGP("%s but no session\n", pptp_msg_name[msg]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pcid = &pptpReq->icack.peersCallID;
|
pcid = pptpReq->icack.peersCallID;
|
||||||
DEBUGP("%s, PCID=%X\n", pptp_msg_name[msg], ntohs(*pcid));
|
DEBUGP("%s, PCID=%X\n", pptp_msg_name[msg], ntohs(pcid));
|
||||||
info->cstate = PPTP_CALL_IN_REQ;
|
info->cstate = PPTP_CALL_IN_REQ;
|
||||||
info->pac_call_id = *pcid;
|
info->pac_call_id = pcid;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPTP_IN_CALL_CONNECT:
|
case PPTP_IN_CALL_CONNECT:
|
||||||
@@ -468,20 +468,20 @@ pptp_inbound_pkt(struct sk_buff **pskb,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pcid = &pptpReq->iccon.peersCallID;
|
pcid = pptpReq->iccon.peersCallID;
|
||||||
cid = &info->pac_call_id;
|
cid = info->pac_call_id;
|
||||||
|
|
||||||
if (info->pns_call_id != *pcid) {
|
if (info->pns_call_id != pcid) {
|
||||||
DEBUGP("%s for unknown CallID %u\n",
|
DEBUGP("%s for unknown CallID %u\n",
|
||||||
pptp_msg_name[msg], ntohs(*pcid));
|
pptp_msg_name[msg], ntohs(pcid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUGP("%s, PCID=%X\n", pptp_msg_name[msg], ntohs(*pcid));
|
DEBUGP("%s, PCID=%X\n", pptp_msg_name[msg], ntohs(pcid));
|
||||||
info->cstate = PPTP_CALL_IN_CONF;
|
info->cstate = PPTP_CALL_IN_CONF;
|
||||||
|
|
||||||
/* we expect a GRE connection from PAC to PNS */
|
/* we expect a GRE connection from PAC to PNS */
|
||||||
exp_gre(ct, *cid, *pcid);
|
exp_gre(ct, cid, pcid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPTP_CALL_DISCONNECT_NOTIFY:
|
case PPTP_CALL_DISCONNECT_NOTIFY:
|
||||||
@@ -491,8 +491,8 @@ pptp_inbound_pkt(struct sk_buff **pskb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* server confirms disconnect */
|
/* server confirms disconnect */
|
||||||
cid = &pptpReq->disc.callID;
|
cid = pptpReq->disc.callID;
|
||||||
DEBUGP("%s, CID=%X\n", pptp_msg_name[msg], ntohs(*cid));
|
DEBUGP("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
|
||||||
info->cstate = PPTP_CALL_NONE;
|
info->cstate = PPTP_CALL_NONE;
|
||||||
|
|
||||||
/* untrack this call id, unexpect GRE packets */
|
/* untrack this call id, unexpect GRE packets */
|
||||||
@@ -534,7 +534,7 @@ pptp_outbound_pkt(struct sk_buff **pskb,
|
|||||||
union pptp_ctrl_union _pptpReq, *pptpReq;
|
union pptp_ctrl_union _pptpReq, *pptpReq;
|
||||||
struct ip_ct_pptp_master *info = &ct->help.ct_pptp_info;
|
struct ip_ct_pptp_master *info = &ct->help.ct_pptp_info;
|
||||||
u_int16_t msg;
|
u_int16_t msg;
|
||||||
__be16 *cid, *pcid;
|
__be16 cid, pcid;
|
||||||
|
|
||||||
ctlh = skb_header_pointer(*pskb, nexthdr_off, sizeof(_ctlh), &_ctlh);
|
ctlh = skb_header_pointer(*pskb, nexthdr_off, sizeof(_ctlh), &_ctlh);
|
||||||
if (!ctlh)
|
if (!ctlh)
|
||||||
@@ -580,9 +580,9 @@ pptp_outbound_pkt(struct sk_buff **pskb,
|
|||||||
}
|
}
|
||||||
info->cstate = PPTP_CALL_OUT_REQ;
|
info->cstate = PPTP_CALL_OUT_REQ;
|
||||||
/* track PNS call id */
|
/* track PNS call id */
|
||||||
cid = &pptpReq->ocreq.callID;
|
cid = pptpReq->ocreq.callID;
|
||||||
DEBUGP("%s, CID=%X\n", pptp_msg_name[msg], ntohs(*cid));
|
DEBUGP("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
|
||||||
info->pns_call_id = *cid;
|
info->pns_call_id = cid;
|
||||||
break;
|
break;
|
||||||
case PPTP_IN_CALL_REPLY:
|
case PPTP_IN_CALL_REPLY:
|
||||||
if (reqlen < sizeof(_pptpReq.icack)) {
|
if (reqlen < sizeof(_pptpReq.icack)) {
|
||||||
@@ -601,16 +601,16 @@ pptp_outbound_pkt(struct sk_buff **pskb,
|
|||||||
info->cstate = PPTP_CALL_NONE;
|
info->cstate = PPTP_CALL_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pcid = &pptpReq->icack.peersCallID;
|
pcid = pptpReq->icack.peersCallID;
|
||||||
if (info->pac_call_id != *pcid) {
|
if (info->pac_call_id != pcid) {
|
||||||
DEBUGP("%s for unknown call %u\n",
|
DEBUGP("%s for unknown call %u\n",
|
||||||
pptp_msg_name[msg], ntohs(*pcid));
|
pptp_msg_name[msg], ntohs(pcid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
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 */
|
/* part two of the three-way handshake */
|
||||||
info->cstate = PPTP_CALL_IN_REP;
|
info->cstate = PPTP_CALL_IN_REP;
|
||||||
info->pns_call_id = pptpReq->icack.callID;
|
info->pns_call_id = pcid;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPTP_CALL_CLEAR_REQUEST:
|
case PPTP_CALL_CLEAR_REQUEST:
|
||||||
|
Reference in New Issue
Block a user