From: henning Date: Tue, 26 Aug 2008 12:17:10 +0000 (+0000) Subject: introduce a function to be called when addressing information has changed, X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9a17359ea40b3bac3f797eec39328d6016d318e3;p=openbsd 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. --- 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);