pf: reduce indentation

Early-return to reduce syncookie-related indentation.

No functional change.

MFC after:	1 week
Reviewed by:	kp
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D41502
This commit is contained in:
Kajetan Staszkiewicz 2023-08-21 07:59:49 +02:00 committed by Kristof Provost
parent 42e70f4283
commit 9642d948c0

View File

@ -7542,40 +7542,34 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0,
pd.dir == PF_IN) {
struct mbuf *msyn;
msyn = pf_syncookie_recreate_syn(h->ip_ttl,
off,&pd);
msyn = pf_syncookie_recreate_syn(h->ip_ttl, off,
&pd);
if (msyn == NULL) {
action = PF_DROP;
break;
}
action = pf_test(dir, pflags, ifp, &msyn, inp, &pd.act);
action = pf_test(dir, pflags, ifp, &msyn, inp,
&pd.act);
m_freem(msyn);
if (action != PF_PASS)
break;
if (action == PF_PASS) {
action = pf_test_state_tcp(&s, kif, m,
off, h, &pd, &reason);
if (action != PF_PASS || s == NULL) {
action = PF_DROP;
break;
}
s->src.seqhi = ntohl(pd.hdr.tcp.th_ack)
- 1;
s->src.seqlo = ntohl(pd.hdr.tcp.th_seq)
- 1;
pf_set_protostate(s, PF_PEER_SRC,
PF_TCPS_PROXY_DST);
action = pf_synproxy(&pd, &s, &reason);
if (action != PF_PASS)
break;
action = pf_test_state_tcp(&s, kif, m, off, h,
&pd, &reason);
if (action != PF_PASS || s == NULL) {
action = PF_DROP;
break;
}
s->src.seqhi = ntohl(pd.hdr.tcp.th_ack) - 1;
s->src.seqlo = ntohl(pd.hdr.tcp.th_seq) - 1;
pf_set_protostate(s, PF_PEER_SRC, PF_TCPS_PROXY_DST);
action = pf_synproxy(&pd, &s, &reason);
break;
}
else {
action = pf_test_rule(&r, &s, kif, m, off,
&pd, &a, &ruleset, inp);
} else {
action = pf_test_rule(&r, &s, kif, m, off, &pd,
&a, &ruleset, inp);
}
}
break;