diff options
author | Kristof Provost <kp@FreeBSD.org> | 2024-12-28 16:00:39 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2024-12-30 20:42:12 +0000 |
commit | ec30ca2e13aec6c1778a008f2ca404bca8d7575f (patch) | |
tree | 6d229bed2ba03070448209b93924bb25e3307eb4 | |
parent | 6553c31c969d13ef58eb1de48f7525654b1fbf08 (diff) |
pf: remove impossible condition
There's no need to account for pd->af == pd->naf in this section of
pf_state_key_setup() because we only get here if pd->af != pd->naf (i.e. nat64).
Pointed out by: markj
Sponsored by: Rubicon Communications, LLC ("Netgate")
-rw-r--r-- | sys/netpfil/pf/pf.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 695ecfc0269d..cd557a9614d1 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1706,12 +1706,10 @@ pf_state_key_setup(struct pf_pdesc *pd, u_int16_t sport, u_int16_t dport, bzero(&(*nk)->addr[0], sizeof((*nk)->addr[0])); bzero(&(*nk)->addr[1], sizeof((*nk)->addr[1])); - PF_ACPY(&(*nk)->addr[pd->af == pd->naf ? pd->sidx : pd->didx], - &pd->nsaddr, pd->naf); - PF_ACPY(&(*nk)->addr[pd->af == pd->naf ? pd->didx : pd->sidx], - &pd->ndaddr, pd->naf); - (*nk)->port[pd->af == pd->naf ? pd->sidx : pd->didx] = pd->nsport; - (*nk)->port[pd->af == pd->naf ? pd->didx : pd->sidx] = pd->ndport; + PF_ACPY(&(*nk)->addr[pd->didx], &pd->nsaddr, pd->naf); + PF_ACPY(&(*nk)->addr[pd->sidx], &pd->ndaddr, pd->naf); + (*nk)->port[pd->didx] = pd->nsport; + (*nk)->port[pd->sidx] = pd->ndport; switch (pd->proto) { case IPPROTO_ICMP: (*nk)->proto = IPPROTO_ICMPV6; |