diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2008-08-26 12:17:11 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2008-08-26 12:17:11 +0000 |
commit | eafc35b6c7ee13c5bfa9f4da49532db44ac40ba5 (patch) | |
tree | 33346e5cc190dfe0eb48bd6f2611f2c146f5a252 | |
parent | 06143ce0d145ec8dd9831075c619bf27bd2ac969 (diff) |
introduce a function to be called when addressing information has changed,
pf_pkt_addr_changed. atm just clears the state key pointer.
calling this is cleaner than having other parts of the stack clearing
pointers in the pf part of the mbuf packet header directly.
-rw-r--r-- | sys/net/pf.c | 12 | ||||
-rw-r--r-- | sys/net/pfvar.h | 3 |
2 files changed, 13 insertions, 2 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 1cbe62743d4..2eeb7c5f0ab 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.615 2008/08/22 00:35:08 bluhm Exp $ */ +/* $OpenBSD: pf.c,v 1.616 2008/08/26 12:17:10 henning Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -6275,3 +6275,13 @@ pf_check_congestion(struct ifqueue *ifq) else return (0); } + +/* + * must be called whenever any addressing information such as + * address, port, protocol has changed + */ +void +pf_pkt_addr_changed(struct mbuf *m) +{ + m->m_pkthdr.pf.statekey = NULL; +} diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index f8103d88976..2e5b13a3e42 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.276 2008/07/03 15:46:23 henning Exp $ */ +/* $OpenBSD: pfvar.h,v 1.277 2008/08/26 12:17:10 henning Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1685,6 +1685,7 @@ int pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *); int pf_rtlabel_match(struct pf_addr *, sa_family_t, struct pf_addr_wrap *); int pf_socket_lookup(int, struct pf_pdesc *); struct pf_state_key *pf_alloc_state_key(int); +void pf_pkt_addr_changed(struct mbuf *); int pf_state_key_attach(struct pf_state_key *, struct pf_state *, int); void pfr_initialize(void); int pfr_match_addr(struct pfr_ktable *, struct pf_addr *, sa_family_t); |