diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2013-06-04 18:58:29 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2013-06-04 18:58:29 +0000 |
commit | 1b79d71415f5c5b8e8f2f7578ccafe0cf6ac20e7 (patch) | |
tree | 79fab2d4b958ae61b3c2ef28ecaa1a0046abe6c8 /sys/net | |
parent | 48c35df062b3396a21315f365fc235346e8e5406 (diff) |
make pf_change_ap() usable without a port. if the port pointer is NULL,
just return after being done with the address. ok bluhm ryan mikeb
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 735592445af..dce0faeee34 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.830 2013/06/03 16:57:05 bluhm Exp $ */ +/* $OpenBSD: pf.c,v 1.831 2013/06/04 18:58:28 henning Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1688,12 +1688,15 @@ pf_change_ap(struct pf_addr *a, u_int16_t *p, u_int16_t *pc, sa_family_t naf) { struct pf_addr ao; - u_int16_t po = *p; + u_int16_t po; PF_ACPY(&ao, a, af); if (af == naf) PF_ACPY(a, an, naf); + if (p == NULL) /* no port -> done. no cksum to worry about. */ + return; + po = *p; *p = pn; switch (af) { |