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")
This commit is contained in:
Kristof Provost
2024-12-28 17:00:39 +01:00
parent 6553c31c96
commit ec30ca2e13
+4 -6
View File
@@ -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;