diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-07-18 13:17:45 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-07-18 13:17:45 +0000 |
commit | 12be0a81b81969927b2c4c7062a769d03115a130 (patch) | |
tree | 7cc76e0674cb0f025d576ce5962a340d78755d11 /sys/netinet/ip_input.c | |
parent | a848f2ceb76bbb0358daddfa3aa213dce50d8b80 (diff) |
Hide pf internals by moving code from in_ouraddr() to pf_ouraddr().
OK mpi@ sashan@
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 432ca7866d0..51f9986e9f6 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.277 2016/06/18 10:36:13 vgross Exp $ */ +/* $OpenBSD: ip_input.c,v 1.278 2016/07/18 13:17:44 bluhm Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -592,20 +592,16 @@ in_ouraddr(struct mbuf *m, struct ifnet *ifp, struct rtentry **prt) struct ip *ip; struct sockaddr_in sin; int match = 0; -#if NPF > 0 - struct pf_state_key *key; - if (m->m_pkthdr.pf.flags & PF_TAG_DIVERTED) +#if NPF > 0 + switch (pf_ouraddr(m)) { + case 0: + return (0); + case 1: return (1); - - key = m->m_pkthdr.pf.statekey; - if (key != NULL) { - if (key->inp != NULL) - return (1); - - /* If we have linked state keys it is certainly forwarded. */ - if (key->reverse != NULL) - return (0); + default: + /* pf does not know it */ + break; } #endif |