-/* $OpenBSD: if_pflog.c,v 1.96 2021/01/20 13:40:15 bluhm Exp $ */
+/* $OpenBSD: if_pflog.c,v 1.97 2021/01/20 23:25:19 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
hdr.dir = pd->dir;
hdr.af = pd->af;
- if (pd->af != pd->naf ||
- pf_addr_compare(pd->src, &pd->nsaddr, pd->naf) != 0 ||
- pf_addr_compare(pd->dst, &pd->ndaddr, pd->naf) != 0 ||
- pd->osport != pd->nsport ||
- pd->odport != pd->ndport) {
- hdr.rewritten = 1;
+ if (pd->src != NULL && pd->dst != NULL) {
+ if (pd->af != pd->naf ||
+ pf_addr_compare(pd->src, &pd->nsaddr, pd->naf) != 0 ||
+ pf_addr_compare(pd->dst, &pd->ndaddr, pd->naf) != 0 ||
+ pd->osport != pd->nsport ||
+ pd->odport != pd->ndport) {
+ hdr.rewritten = 1;
+ }
}
hdr.naf = pd->naf;
pf_addrcpy(&hdr.saddr, &pd->nsaddr, pd->naf);