diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2002-12-27 21:43:59 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2002-12-27 21:43:59 +0000 |
commit | 6468be5d29b9424086adb158f6424bdaa55b2c02 (patch) | |
tree | 528182cf216d150a00a87479f09654f2b2c19891 /sys/net/pf.c | |
parent | 3ddcaa9a2954b43daedd269e555e317bab603253 (diff) |
Fixups for pf_route and pf_route6.
- pull the route-to ifp from the current pf_pooladdr (not the last one)
with stateful rules
- remove unnecessary PF_ACPY and PF_AZERO
ok dhartme@ on pf_route version, pf_route6 is the same.
Diffstat (limited to 'sys/net/pf.c')
-rw-r--r-- | sys/net/pf.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index d47eda4ac79..7fd4179502e 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.286 2002/12/27 16:55:15 dhartmei Exp $ */ +/* $OpenBSD: pf.c,v 1.287 2002/12/27 21:43:58 mcbride Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -3840,12 +3840,10 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp, ifp = r->rpool.cur->ifp; } else { if (s->rt_ifp == NULL) { - s->rt_ifp = r->rpool.cur->ifp; pf_map_addr(AF_INET, &r->rpool, (struct pf_addr *)&ip->ip_src, - &naddr, NULL); - if (!PF_AZERO(&naddr, AF_INET)) - PF_ACPY(&s->rt_addr, &naddr, AF_INET); + &s->rt_addr, NULL); + s->rt_ifp = r->rpool.cur->ifp; } if (!PF_AZERO(&s->rt_addr, AF_INET)) dst->sin_addr.s_addr = @@ -4001,16 +3999,14 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp, ifp = r->rpool.cur->ifp; } else { if (s->rt_ifp == NULL) { - s->rt_ifp = r->rpool.cur->ifp; pf_map_addr(AF_INET6, &r->rpool, (struct pf_addr *)&ip6->ip6_src, - &naddr, NULL); - if (!PF_AZERO(&naddr, AF_INET6)) - PF_ACPY(&s->rt_addr, &naddr, AF_INET6); + &s->rt_addr, NULL); + s->rt_ifp = r->rpool.cur->ifp; } if (!PF_AZERO(&s->rt_addr, AF_INET6)) PF_ACPY((struct pf_addr *)&dst->sin6_addr, - &naddr, AF_INET6); + &s->rt_addr, AF_INET6); ifp = s->rt_ifp; } |