if_fddisubr.c (33676) | if_fddisubr.c (34961) |
---|---|
1/* 2 * Copyright (c) 1995, 1996 3 * Matt Thomas <matt@3am-software.com>. All rights reserved. 4 * Copyright (c) 1982, 1989, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp | 1/* 2 * Copyright (c) 1995, 1996 3 * Matt Thomas <matt@3am-software.com>. All rights reserved. 4 * Copyright (c) 1982, 1989, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp |
36 * $Id: if_fddisubr.c,v 1.25 1998/01/09 00:51:55 eivind Exp $ | 36 * $Id: if_fddisubr.c,v 1.26 1998/02/20 13:11:49 bde Exp $ |
37 */ 38 39#include "opt_atalk.h" 40#include "opt_inet.h" 41#include "opt_ipx.h" 42 43#include <sys/param.h> 44#include <sys/systm.h> --- 99 unchanged lines hidden (view full) --- 144 register struct mbuf *m = m0; 145 register struct rtentry *rt; 146 register struct fddi_header *fh; 147 struct mbuf *mcopy = (struct mbuf *)0; 148 struct arpcom *ac = (struct arpcom *)ifp; 149 150 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) 151 senderr(ENETDOWN); | 37 */ 38 39#include "opt_atalk.h" 40#include "opt_inet.h" 41#include "opt_ipx.h" 42 43#include <sys/param.h> 44#include <sys/systm.h> --- 99 unchanged lines hidden (view full) --- 144 register struct mbuf *m = m0; 145 register struct rtentry *rt; 146 register struct fddi_header *fh; 147 struct mbuf *mcopy = (struct mbuf *)0; 148 struct arpcom *ac = (struct arpcom *)ifp; 149 150 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) 151 senderr(ENETDOWN); |
152 gettime(&ifp->if_lastchange); | 152 getmicrotime(&ifp->if_lastchange); |
153#if !defined(__bsdi__) || _BSDI_VERSION >= 199401 154 if (rt = rt0) { 155 if ((rt->rt_flags & RTF_UP) == 0) { 156 if (rt0 = rt = RTALLOC1(dst, 1)) 157 rt->rt_refcnt--; 158 else 159 senderr(EHOSTUNREACH); 160 } --- 4 unchanged lines hidden (view full) --- 165 rtfree(rt); rt = rt0; 166 lookup: rt->rt_gwroute = RTALLOC1(rt->rt_gateway, 1); 167 if ((rt = rt->rt_gwroute) == 0) 168 senderr(EHOSTUNREACH); 169 } 170 } 171 if (rt->rt_flags & RTF_REJECT) 172 if (rt->rt_rmx.rmx_expire == 0 || | 153#if !defined(__bsdi__) || _BSDI_VERSION >= 199401 154 if (rt = rt0) { 155 if ((rt->rt_flags & RTF_UP) == 0) { 156 if (rt0 = rt = RTALLOC1(dst, 1)) 157 rt->rt_refcnt--; 158 else 159 senderr(EHOSTUNREACH); 160 } --- 4 unchanged lines hidden (view full) --- 165 rtfree(rt); rt = rt0; 166 lookup: rt->rt_gwroute = RTALLOC1(rt->rt_gateway, 1); 167 if ((rt = rt->rt_gwroute) == 0) 168 senderr(EHOSTUNREACH); 169 } 170 } 171 if (rt->rt_flags & RTF_REJECT) 172 if (rt->rt_rmx.rmx_expire == 0 || |
173 time.tv_sec < rt->rt_rmx.rmx_expire) | 173 time_second < rt->rt_rmx.rmx_expire) |
174 senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH); 175 } 176#endif 177 switch (dst->sa_family) { 178 179#ifdef INET 180 case AF_INET: { 181#if !defined(__bsdi__) || _BSDI_VERSION >= 199401 --- 287 unchanged lines hidden (view full) --- 469 register struct ifqueue *inq; 470 register struct llc *l; 471 int s; 472 473 if ((ifp->if_flags & IFF_UP) == 0) { 474 m_freem(m); 475 return; 476 } | 174 senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH); 175 } 176#endif 177 switch (dst->sa_family) { 178 179#ifdef INET 180 case AF_INET: { 181#if !defined(__bsdi__) || _BSDI_VERSION >= 199401 --- 287 unchanged lines hidden (view full) --- 469 register struct ifqueue *inq; 470 register struct llc *l; 471 int s; 472 473 if ((ifp->if_flags & IFF_UP) == 0) { 474 m_freem(m); 475 return; 476 } |
477 gettime(&ifp->if_lastchange); | 477 getmicrotime(&ifp->if_lastchange); |
478 ifp->if_ibytes += m->m_pkthdr.len + sizeof (*fh); 479 if (fh->fddi_dhost[0] & 1) { 480 if (bcmp((caddr_t)fddibroadcastaddr, (caddr_t)fh->fddi_dhost, 481 sizeof(fddibroadcastaddr)) == 0) 482 m->m_flags |= M_BCAST; 483 else 484 m->m_flags |= M_MCAST; 485 ifp->if_imcasts++; --- 245 unchanged lines hidden --- | 478 ifp->if_ibytes += m->m_pkthdr.len + sizeof (*fh); 479 if (fh->fddi_dhost[0] & 1) { 480 if (bcmp((caddr_t)fddibroadcastaddr, (caddr_t)fh->fddi_dhost, 481 sizeof(fddibroadcastaddr)) == 0) 482 m->m_flags |= M_BCAST; 483 else 484 m->m_flags |= M_MCAST; 485 ifp->if_imcasts++; --- 245 unchanged lines hidden --- |