diff options
author | 2010-07-08 08:40:29 +0000 | |
---|---|---|
committer | 2010-07-08 08:40:29 +0000 | |
commit | 50bc8e1fb8145a8f8635af44d65d35d5f4f07606 (patch) | |
tree | 657bd4d023bda1f2a0692cb8d561eaae396543f1 /sys/net/if_tun.c | |
parent | better op buf handling. Instead of mallocing a new buffer for every (diff) | |
download | wireguard-openbsd-50bc8e1fb8145a8f8635af44d65d35d5f4f07606.tar.xz wireguard-openbsd-50bc8e1fb8145a8f8635af44d65d35d5f4f07606.zip |
pipex didn't work on output. Fixed following problems:
- pipex failed to lookup the radix tree because address and netmask
were not initialized.
- pipex used wrong place as a ip header because it didn't adjust
32bit address family header that are added at tun_output.
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 844f9542826..2e4b3ee9391 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.106 2010/05/06 13:06:40 claudio Exp $ */ +/* $OpenBSD: if_tun.c,v 1.107 2010/07/08 08:40:29 yasuoka Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -574,9 +574,6 @@ tun_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, struct tun_softc *tp = ifp->if_softc; int s, len, error; u_int32_t *af; -#ifdef PIPEX - struct pipex_session *session; -#endif if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) { m_freem(m0); @@ -609,8 +606,8 @@ tun_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT); #endif #ifdef PIPEX - if ((session = pipex_ip_lookup_session(m0, &tp->pipex_iface)) != NULL) { - pipex_ip_output(m0, session); + if ((m0 = pipex_output(m0, dst->sa_family, sizeof(u_int32_t), + &tp->pipex_iface)) == NULL) { splx(s); return (0); } |