From 2d7d383bb75e7bb82763c67e05af41c00059465d Mon Sep 17 00:00:00 2001 From: jhay Date: Wed, 8 May 1996 19:31:48 +0000 Subject: Make IPXIP work. Reviewed by: Gary Palmer gpalmer@FreeBSD.ORG --- sys/netipx/ipx_error.c | 4 +++- sys/netipx/ipx_ip.c | 20 +++++++++----------- sys/netipx/ipx_ip.h | 6 +++--- sys/netipx/ipx_usrreq.c | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'sys/netipx') diff --git a/sys/netipx/ipx_error.c b/sys/netipx/ipx_error.c index 20fc5f2..e711f0e 100644 --- a/sys/netipx/ipx_error.c +++ b/sys/netipx/ipx_error.c @@ -33,7 +33,7 @@ * * @(#)ipx_error.c * - * $Id: ipx_error.c,v 1.3 1995/11/04 09:02:43 julian Exp $ + * $Id: ipx_error.c,v 1.4 1995/12/16 02:14:32 bde Exp $ */ #include @@ -142,6 +142,8 @@ ipx_error(om, type, param) if (m == NULL) goto freeit; m->m_len = sizeof(*ep); + m->m_pkthdr.len = m->m_len; + m->m_pkthdr.rcvif = om->m_pkthdr.rcvif; MH_ALIGN(m, m->m_len); ep = mtod(m, struct ipx_epipx *); if ((u_int)type > IPX_ERR_TOO_BIG) diff --git a/sys/netipx/ipx_ip.c b/sys/netipx/ipx_ip.c index 81aaa04..1b7624f 100644 --- a/sys/netipx/ipx_ip.c +++ b/sys/netipx/ipx_ip.c @@ -33,7 +33,7 @@ * * @(#)ipx_ip.c * - * $Id: ipx_ip.c,v 1.6 1995/12/16 02:14:34 bde Exp $ + * $Id: ipx_ip.c,v 1.7 1996/03/11 15:13:50 davidg Exp $ */ /* @@ -89,6 +89,7 @@ ipxipattach() MALLOC((m), struct ifnet_en *, sizeof(*m), M_PCB, M_NOWAIT); if (m == NULL) return (NULL); + bzero(m, sizeof(*m)); m->ifen_next = ipxip_list; ipxip_list = m; ifp = &m->ifen_ifnet; @@ -148,9 +149,9 @@ struct mbuf *ipxip_lastin; int ipxip_hold_input; void -ipxip_input(m, ifp) +ipxip_input(m, hlen) register struct mbuf *m; - struct ifnet *ifp; + int hlen; { register struct ip *ip; register struct ipx *ipx; @@ -206,11 +207,6 @@ ipxip_input(m, ifp) } /* - * Place interface pointer before the data - * for the receiving protocol. - */ - m->m_pkthdr.rcvif = ifp; - /* * Deliver to IPX */ s = splimp(); @@ -265,6 +261,7 @@ ipxipoutput(ifp, m, dst, rt) m0->m_len = sizeof (struct ip); m0->m_pkthdr.len = m0->m_len + m->m_len; m->m_flags &= ~M_PKTHDR; + m = m0; } else { M_PREPEND(m, sizeof (struct ip), M_DONTWAIT); if (m == 0) @@ -305,7 +302,8 @@ struct ifnet *ifp; struct ifreq ifr_ipxip = {"ipxip0"}; int -ipxip_route(m) +ipxip_route(so, m) + struct socket *so; register struct mbuf *m; { register struct ipxip_req *rq = mtod(m, struct ipxip_req *); @@ -372,10 +370,10 @@ ipxip_route(m) */ ifr_ipxip.ifr_name[4] = '0' + ipxipif.if_unit - 1; ifr_ipxip.ifr_dstaddr = * (struct sockaddr *) ipx_dst; - (void)ipx_control((struct socket *)0, (int)SIOCSIFDSTADDR, (caddr_t)&ifr_ipxip, + (void)ipx_control(so, (int)SIOCSIFDSTADDR, (caddr_t)&ifr_ipxip, (struct ifnet *)ifn); satoipx_addr(ifr_ipxip.ifr_addr).x_host = ipx_thishost; - return (ipx_control((struct socket *)0, (int)SIOCSIFADDR, (caddr_t)&ifr_ipxip, + return (ipx_control(so, (int)SIOCSIFADDR, (caddr_t)&ifr_ipxip, (struct ifnet *)ifn)); } diff --git a/sys/netipx/ipx_ip.h b/sys/netipx/ipx_ip.h index ead13fe..521ee2a 100644 --- a/sys/netipx/ipx_ip.h +++ b/sys/netipx/ipx_ip.h @@ -33,7 +33,7 @@ * * @(#)ipxip.h * - * $Id: ipx_ip.h,v 1.4 1995/11/24 12:25:07 bde Exp $ + * $Id: ipx_ip.h,v 1.5 1995/12/16 03:43:49 bde Exp $ */ #ifndef _NETIPX_IPXIP_H_ @@ -58,11 +58,11 @@ struct ifnet_en * ipxipattach __P((void)); void ipxip_ctlinput __P((int cmd, struct sockaddr *sa, void *arg)); int ipxip_free __P((struct ifnet *ifp)); -void ipxip_input __P((struct mbuf *m, struct ifnet *ifp)); +void ipxip_input __P((struct mbuf *m, int hlen)); int ipxipioctl __P((struct ifnet *ifp, int cmd, caddr_t data)); int ipxipoutput __P((struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rt)); -int ipxip_route __P((struct mbuf *m)); +int ipxip_route __P((struct socket *so, struct mbuf *m)); void ipxip_rtchange __P((struct in_addr *dst)); void ipxipstart __P((struct ifnet *ifp)); diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c index 6a0fc4a..6474975 100644 --- a/sys/netipx/ipx_usrreq.c +++ b/sys/netipx/ipx_usrreq.c @@ -33,7 +33,7 @@ * * @(#)ipx_usrreq.c * - * $Id: ipx_usrreq.c,v 1.5 1996/03/11 15:13:57 davidg Exp $ + * $Id: ipx_usrreq.c,v 1.6 1996/04/13 14:37:22 jhay Exp $ */ #include @@ -369,12 +369,12 @@ ipx_ctloutput(req, so, level, name, value) break; #ifdef IPXIP case SO_IPXIP_ROUTE: - error = ipxip_route(*value); + error = ipxip_route(so, *value); break; #endif /* IPXIP */ #ifdef IPXTUNNEL case SO_IPXTUNNEL_ROUTE - error = ipxtun_route(*value); + error = ipxtun_route(so, *value); break; #endif default: -- cgit v1.1