diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2013-10-28 12:09:42 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2013-10-28 12:09:42 +0000 |
commit | 812c3d9bada1317588f2b663b04c685b4bf4cff8 (patch) | |
tree | 622836ef1f6ded8d2965d2bec599506e14aa44a9 | |
parent | 8ca4c62d71a8dc35c0912c14fc3ed0a41ed0d1ba (diff) |
previous udp port number rewrite fix turned out to be a work around
the incorrect pf_change_ap call; while here make the tcp case use
pf_change_ap since it shares the same properties. ok henning
-rw-r--r-- | sys/net/pf.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 62b864ce8fe..c75ae4680dc 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.854 2013/10/24 11:14:33 deraadt Exp $ */ +/* $OpenBSD: pf.c,v 1.855 2013/10/28 12:09:41 mikeb Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -4862,8 +4862,12 @@ pf_test_state_icmp(struct pf_pdesc *pd, struct pf_state **state, pd->proto = IPPROTO_ICMP; else pd->proto = IPPROTO_ICMPV6; - th.th_sport = nk->port[sidx]; - th.th_dport = nk->port[didx]; + pf_change_ap(pd, pd2.src, &th.th_sport, + &nk->addr[pd2.sidx], nk->port[sidx], + nk->af); + pf_change_ap(pd, pd2.dst, &th.th_dport, + &nk->addr[pd2.didx], nk->port[didx], + nk->af); m_copyback(pd2.m, pd2.off, 8, &th, M_NOWAIT); pd->m->m_pkthdr.rdomain = nk->rdomain; @@ -4974,14 +4978,12 @@ pf_test_state_icmp(struct pf_pdesc *pd, struct pf_state **state, pd->proto = IPPROTO_ICMP; else pd->proto = IPPROTO_ICMPV6; - pf_change_ap(pd, pd2.src, - &uh.uh_sum, &nk->addr[pd2.sidx], - nk->port[sidx], nk->af); - pf_change_ap(pd, pd2.dst, - &uh.uh_sum, &nk->addr[pd2.didx], - nk->port[didx], nk->af); - uh.uh_sport = nk->port[sidx]; - uh.uh_dport = nk->port[didx]; + pf_change_ap(pd, pd2.src, &uh.uh_sport, + &nk->addr[pd2.sidx], nk->port[sidx], + nk->af); + pf_change_ap(pd, pd2.dst, &uh.uh_dport, + &nk->addr[pd2.didx], nk->port[didx], + nk->af); m_copyback(pd2.m, pd2.off, sizeof(uh), &uh, M_NOWAIT); pd->m->m_pkthdr.rdomain = nk->rdomain; |