Commit cbe1f5f8 authored by Gerrit Renker's avatar Gerrit Renker Committed by David S. Miller

[DCCP]: Shorten variable names in dccp_check_seqno

This patch is in part required by the next patch; it

 * replaces 6 instances of `DCCP_SKB_CB(skb)->dccpd_seq' with `seqno';
 * replaces 7 instances of `DCCP_SKB_CB(skb)->dccpd_ack_seq' with `ackno';
 * replaces 1 use of dccp_inc_seqno() by unfolding `ADD48' macro in place.

No changes in algorithm, all changes are text replacement/substitution.
Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3393da82
...@@ -68,7 +68,8 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) ...@@ -68,7 +68,8 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb)
{ {
const struct dccp_hdr *dh = dccp_hdr(skb); const struct dccp_hdr *dh = dccp_hdr(skb);
struct dccp_sock *dp = dccp_sk(sk); struct dccp_sock *dp = dccp_sk(sk);
u64 lswl, lawl; u64 lswl, lawl, seqno = DCCP_SKB_CB(skb)->dccpd_seq,
ackno = DCCP_SKB_CB(skb)->dccpd_ack_seq;
/* /*
* Step 5: Prepare sequence numbers for Sync * Step 5: Prepare sequence numbers for Sync
...@@ -84,11 +85,9 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) ...@@ -84,11 +85,9 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb)
*/ */
if (dh->dccph_type == DCCP_PKT_SYNC || if (dh->dccph_type == DCCP_PKT_SYNC ||
dh->dccph_type == DCCP_PKT_SYNCACK) { dh->dccph_type == DCCP_PKT_SYNCACK) {
if (between48(DCCP_SKB_CB(skb)->dccpd_ack_seq, if (between48(ackno, dp->dccps_awl, dp->dccps_awh) &&
dp->dccps_awl, dp->dccps_awh) && dccp_delta_seqno(dp->dccps_swl, seqno) >= 0)
dccp_delta_seqno(dp->dccps_swl, dccp_update_gsr(sk, seqno);
DCCP_SKB_CB(skb)->dccpd_seq) >= 0)
dccp_update_gsr(sk, DCCP_SKB_CB(skb)->dccpd_seq);
else else
return -1; return -1;
} }
...@@ -113,35 +112,30 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) ...@@ -113,35 +112,30 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb)
if (dh->dccph_type == DCCP_PKT_CLOSEREQ || if (dh->dccph_type == DCCP_PKT_CLOSEREQ ||
dh->dccph_type == DCCP_PKT_CLOSE || dh->dccph_type == DCCP_PKT_CLOSE ||
dh->dccph_type == DCCP_PKT_RESET) { dh->dccph_type == DCCP_PKT_RESET) {
lswl = dp->dccps_gsr; lswl = ADD48(dp->dccps_gsr, 1);
dccp_inc_seqno(&lswl);
lawl = dp->dccps_gar; lawl = dp->dccps_gar;
} }
if (between48(DCCP_SKB_CB(skb)->dccpd_seq, lswl, dp->dccps_swh) && if (between48(seqno, lswl, dp->dccps_swh) &&
(DCCP_SKB_CB(skb)->dccpd_ack_seq == DCCP_PKT_WITHOUT_ACK_SEQ || (ackno == DCCP_PKT_WITHOUT_ACK_SEQ ||
between48(DCCP_SKB_CB(skb)->dccpd_ack_seq, between48(ackno, lawl, dp->dccps_awh))) {
lawl, dp->dccps_awh))) { dccp_update_gsr(sk, seqno);
dccp_update_gsr(sk, DCCP_SKB_CB(skb)->dccpd_seq);
if (dh->dccph_type != DCCP_PKT_SYNC && if (dh->dccph_type != DCCP_PKT_SYNC &&
(DCCP_SKB_CB(skb)->dccpd_ack_seq != (ackno != DCCP_PKT_WITHOUT_ACK_SEQ))
DCCP_PKT_WITHOUT_ACK_SEQ)) dp->dccps_gar = ackno;
dp->dccps_gar = DCCP_SKB_CB(skb)->dccpd_ack_seq;
} else { } else {
DCCP_WARN("DCCP: Step 6 failed for %s packet, " DCCP_WARN("DCCP: Step 6 failed for %s packet, "
"(LSWL(%llu) <= P.seqno(%llu) <= S.SWH(%llu)) and " "(LSWL(%llu) <= P.seqno(%llu) <= S.SWH(%llu)) and "
"(P.ackno %s or LAWL(%llu) <= P.ackno(%llu) <= S.AWH(%llu), " "(P.ackno %s or LAWL(%llu) <= P.ackno(%llu) <= S.AWH(%llu), "
"sending SYNC...\n", dccp_packet_name(dh->dccph_type), "sending SYNC...\n", dccp_packet_name(dh->dccph_type),
(unsigned long long) lswl, (unsigned long long) lswl, (unsigned long long) seqno,
(unsigned long long) DCCP_SKB_CB(skb)->dccpd_seq,
(unsigned long long) dp->dccps_swh, (unsigned long long) dp->dccps_swh,
(DCCP_SKB_CB(skb)->dccpd_ack_seq == (ackno == DCCP_PKT_WITHOUT_ACK_SEQ) ? "doesn't exist"
DCCP_PKT_WITHOUT_ACK_SEQ) ? "doesn't exist" : "exists", : "exists",
(unsigned long long) lawl, (unsigned long long) lawl, (unsigned long long) ackno,
(unsigned long long) DCCP_SKB_CB(skb)->dccpd_ack_seq,
(unsigned long long) dp->dccps_awh); (unsigned long long) dp->dccps_awh);
dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, DCCP_PKT_SYNC); dccp_send_sync(sk, seqno, DCCP_PKT_SYNC);
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment