mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
pf: Remove unused arguments from pf_send_tcp()
struct mbuf *replyto is not actually used (and only rarely provided). The same applies to struct ifnet *ifp. No functional change. Reviewed by: mjg MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31136
This commit is contained in:
parent
0351b9875a
commit
295f2d939d
1 changed files with 20 additions and 22 deletions
|
|
@ -243,12 +243,11 @@ static void pf_change_icmp(struct pf_addr *, u_int16_t *,
|
|||
struct pf_addr *, struct pf_addr *, u_int16_t,
|
||||
u_int16_t *, u_int16_t *, u_int16_t *,
|
||||
u_int16_t *, u_int8_t, sa_family_t);
|
||||
static void pf_send_tcp(struct mbuf *,
|
||||
const struct pf_krule *, sa_family_t,
|
||||
static void pf_send_tcp(const struct pf_krule *, sa_family_t,
|
||||
const struct pf_addr *, const struct pf_addr *,
|
||||
u_int16_t, u_int16_t, u_int32_t, u_int32_t,
|
||||
u_int8_t, u_int16_t, u_int16_t, u_int8_t, int,
|
||||
u_int16_t, struct ifnet *);
|
||||
u_int16_t);
|
||||
static void pf_send_icmp(struct mbuf *, u_int8_t, u_int8_t,
|
||||
sa_family_t, struct pf_krule *);
|
||||
static void pf_detach_state(struct pf_kstate *);
|
||||
|
|
@ -1725,13 +1724,13 @@ pf_unlink_state(struct pf_kstate *s, u_int flags)
|
|||
|
||||
if (s->src.state == PF_TCPS_PROXY_DST) {
|
||||
/* XXX wire key the right one? */
|
||||
pf_send_tcp(NULL, s->rule.ptr, s->key[PF_SK_WIRE]->af,
|
||||
pf_send_tcp(s->rule.ptr, s->key[PF_SK_WIRE]->af,
|
||||
&s->key[PF_SK_WIRE]->addr[1],
|
||||
&s->key[PF_SK_WIRE]->addr[0],
|
||||
s->key[PF_SK_WIRE]->port[1],
|
||||
s->key[PF_SK_WIRE]->port[0],
|
||||
s->src.seqhi, s->src.seqlo + 1,
|
||||
TH_RST|TH_ACK, 0, 0, 0, 1, s->tag, NULL);
|
||||
TH_RST|TH_ACK, 0, 0, 0, 1, s->tag);
|
||||
}
|
||||
|
||||
LIST_REMOVE(s, entry);
|
||||
|
|
@ -2461,11 +2460,11 @@ pf_modulate_sack(struct mbuf *m, int off, struct pf_pdesc *pd,
|
|||
}
|
||||
|
||||
static void
|
||||
pf_send_tcp(struct mbuf *replyto, const struct pf_krule *r, sa_family_t af,
|
||||
pf_send_tcp(const struct pf_krule *r, sa_family_t af,
|
||||
const struct pf_addr *saddr, const struct pf_addr *daddr,
|
||||
u_int16_t sport, u_int16_t dport, u_int32_t seq, u_int32_t ack,
|
||||
u_int8_t flags, u_int16_t win, u_int16_t mss, u_int8_t ttl, int tag,
|
||||
u_int16_t rtag, struct ifnet *ifp)
|
||||
u_int16_t rtag)
|
||||
{
|
||||
struct pf_send_entry *pfse;
|
||||
struct mbuf *m;
|
||||
|
|
@ -2679,10 +2678,10 @@ pf_return(struct pf_krule *r, struct pf_krule *nr, struct pf_pdesc *pd,
|
|||
ack++;
|
||||
if (th->th_flags & TH_FIN)
|
||||
ack++;
|
||||
pf_send_tcp(m, r, af, pd->dst,
|
||||
pf_send_tcp(r, af, pd->dst,
|
||||
pd->src, th->th_dport, th->th_sport,
|
||||
ntohl(th->th_ack), ack, TH_RST|TH_ACK, 0, 0,
|
||||
r->return_ttl, 1, 0, kif->pfik_ifp);
|
||||
r->return_ttl, 1, 0);
|
||||
}
|
||||
} else if (pd->proto != IPPROTO_ICMP && af == AF_INET &&
|
||||
r->return_icmp)
|
||||
|
|
@ -3941,9 +3940,9 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a,
|
|||
mss = pf_calc_mss(pd->src, pd->af, rtid, mss);
|
||||
mss = pf_calc_mss(pd->dst, pd->af, rtid, mss);
|
||||
s->src.mss = mss;
|
||||
pf_send_tcp(NULL, r, pd->af, pd->dst, pd->src, th->th_dport,
|
||||
pf_send_tcp(r, pd->af, pd->dst, pd->src, th->th_dport,
|
||||
th->th_sport, s->src.seqhi, ntohl(th->th_seq) + 1,
|
||||
TH_SYN|TH_ACK, 0, s->src.mss, 0, 1, 0, NULL);
|
||||
TH_SYN|TH_ACK, 0, s->src.mss, 0, 1, 0);
|
||||
REASON_SET(&reason, PFRES_SYNPROXY);
|
||||
return (PF_SYNPROXY_DROP);
|
||||
}
|
||||
|
|
@ -4385,12 +4384,11 @@ pf_tcp_track_full(struct pf_state_peer *src, struct pf_state_peer *dst,
|
|||
(*state)->src.state == TCPS_SYN_SENT) {
|
||||
/* Send RST for state mismatches during handshake */
|
||||
if (!(th->th_flags & TH_RST))
|
||||
pf_send_tcp(NULL, (*state)->rule.ptr, pd->af,
|
||||
pf_send_tcp((*state)->rule.ptr, pd->af,
|
||||
pd->dst, pd->src, th->th_dport,
|
||||
th->th_sport, ntohl(th->th_ack), 0,
|
||||
TH_RST, 0, 0,
|
||||
(*state)->rule.ptr->return_ttl, 1, 0,
|
||||
kif->pfik_ifp);
|
||||
(*state)->rule.ptr->return_ttl, 1, 0);
|
||||
src->seqlo = 0;
|
||||
src->seqhi = 1;
|
||||
src->max_win = 1;
|
||||
|
|
@ -4540,10 +4538,10 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif,
|
|||
REASON_SET(reason, PFRES_SYNPROXY);
|
||||
return (PF_DROP);
|
||||
}
|
||||
pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst,
|
||||
pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst,
|
||||
pd->src, th->th_dport, th->th_sport,
|
||||
(*state)->src.seqhi, ntohl(th->th_seq) + 1,
|
||||
TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, 0, NULL);
|
||||
TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, 0);
|
||||
REASON_SET(reason, PFRES_SYNPROXY);
|
||||
return (PF_SYNPROXY_DROP);
|
||||
} else if ((th->th_flags & (TH_ACK|TH_RST|TH_FIN)) != TH_ACK ||
|
||||
|
|
@ -4569,11 +4567,11 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif,
|
|||
(*state)->src.max_win = MAX(ntohs(th->th_win), 1);
|
||||
if ((*state)->dst.seqhi == 1)
|
||||
(*state)->dst.seqhi = htonl(arc4random());
|
||||
pf_send_tcp(NULL, (*state)->rule.ptr, pd->af,
|
||||
pf_send_tcp((*state)->rule.ptr, pd->af,
|
||||
&sk->addr[pd->sidx], &sk->addr[pd->didx],
|
||||
sk->port[pd->sidx], sk->port[pd->didx],
|
||||
(*state)->dst.seqhi, 0, TH_SYN, 0,
|
||||
(*state)->src.mss, 0, 0, (*state)->tag, NULL);
|
||||
(*state)->src.mss, 0, 0, (*state)->tag);
|
||||
REASON_SET(reason, PFRES_SYNPROXY);
|
||||
return (PF_SYNPROXY_DROP);
|
||||
} else if (((th->th_flags & (TH_SYN|TH_ACK)) !=
|
||||
|
|
@ -4584,16 +4582,16 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif,
|
|||
} else {
|
||||
(*state)->dst.max_win = MAX(ntohs(th->th_win), 1);
|
||||
(*state)->dst.seqlo = ntohl(th->th_seq);
|
||||
pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst,
|
||||
pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst,
|
||||
pd->src, th->th_dport, th->th_sport,
|
||||
ntohl(th->th_ack), ntohl(th->th_seq) + 1,
|
||||
TH_ACK, (*state)->src.max_win, 0, 0, 0,
|
||||
(*state)->tag, NULL);
|
||||
pf_send_tcp(NULL, (*state)->rule.ptr, pd->af,
|
||||
(*state)->tag);
|
||||
pf_send_tcp((*state)->rule.ptr, pd->af,
|
||||
&sk->addr[pd->sidx], &sk->addr[pd->didx],
|
||||
sk->port[pd->sidx], sk->port[pd->didx],
|
||||
(*state)->src.seqhi + 1, (*state)->src.seqlo + 1,
|
||||
TH_ACK, (*state)->dst.max_win, 0, 0, 1, 0, NULL);
|
||||
TH_ACK, (*state)->dst.max_win, 0, 0, 1, 0);
|
||||
(*state)->src.seqdiff = (*state)->dst.seqhi -
|
||||
(*state)->src.seqlo;
|
||||
(*state)->dst.seqdiff = (*state)->src.seqhi -
|
||||
|
|
|
|||
Loading…
Reference in a new issue