Deleted Added
full compact
if_fddisubr.c (68315) if_fddisubr.c (69152)
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 * $FreeBSD: head/sys/net/if_fddisubr.c 68315 2000-11-04 14:21:23Z ume $
36 * $FreeBSD: head/sys/net/if_fddisubr.c 69152 2000-11-25 07:35:38Z jlemon $
37 */
38
39#include "opt_atalk.h"
40#include "opt_inet.h"
41#include "opt_inet6.h"
42#include "opt_ipx.h"
43
44#include <sys/param.h>

--- 78 unchanged lines hidden (view full) ---

123int
124fddi_output(ifp, m, dst, rt0)
125 register struct ifnet *ifp;
126 struct mbuf *m;
127 struct sockaddr *dst;
128 struct rtentry *rt0;
129{
130 u_int16_t type;
37 */
38
39#include "opt_atalk.h"
40#include "opt_inet.h"
41#include "opt_inet6.h"
42#include "opt_ipx.h"
43
44#include <sys/param.h>

--- 78 unchanged lines hidden (view full) ---

123int
124fddi_output(ifp, m, dst, rt0)
125 register struct ifnet *ifp;
126 struct mbuf *m;
127 struct sockaddr *dst;
128 struct rtentry *rt0;
129{
130 u_int16_t type;
131 int s, loop_copy = 0, error = 0, hdrcmplt = 0;
131 int loop_copy = 0, error = 0, hdrcmplt = 0;
132 u_char esrc[6], edst[6];
133 register struct rtentry *rt;
134 register struct fddi_header *fh;
135 struct arpcom *ac = (struct arpcom *)ifp;
136
137 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
138 senderr(ENETDOWN);
139 getmicrotime(&ifp->if_lastchange);

--- 205 unchanged lines hidden (view full) ---

345 } else if (bcmp(fh->fddi_dhost,
346 fh->fddi_shost, sizeof(fh->fddi_shost)) == 0) {
347 (void) if_simloop(ifp,
348 m, dst->sa_family, sizeof(struct fddi_header));
349 return(0); /* XXX */
350 }
351 }
352
132 u_char esrc[6], edst[6];
133 register struct rtentry *rt;
134 register struct fddi_header *fh;
135 struct arpcom *ac = (struct arpcom *)ifp;
136
137 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
138 senderr(ENETDOWN);
139 getmicrotime(&ifp->if_lastchange);

--- 205 unchanged lines hidden (view full) ---

345 } else if (bcmp(fh->fddi_dhost,
346 fh->fddi_shost, sizeof(fh->fddi_shost)) == 0) {
347 (void) if_simloop(ifp,
348 m, dst->sa_family, sizeof(struct fddi_header));
349 return(0); /* XXX */
350 }
351 }
352
353 s = splimp();
354 /*
355 * Queue message on interface, and start output if interface
356 * not yet active.
357 */
358 if (IF_QFULL(&ifp->if_snd)) {
359 IF_DROP(&ifp->if_snd);
360 splx(s);
353 if (! IF_HANDOFF(&ifp->if_snd, m, ifp))
361 senderr(ENOBUFS);
354 senderr(ENOBUFS);
362 }
363 ifp->if_obytes += m->m_pkthdr.len;
364 if (m->m_flags & M_MCAST)
365 ifp->if_omcasts++;
366 IF_ENQUEUE(&ifp->if_snd, m);
367 if ((ifp->if_flags & IFF_OACTIVE) == 0)
368 (*ifp->if_start)(ifp);
369 splx(s);
370 return (error);
371
372bad:
373 if (m)
374 m_freem(m);
375 return (error);
376}
377

--- 5 unchanged lines hidden (view full) ---

383void
384fddi_input(ifp, fh, m)
385 struct ifnet *ifp;
386 register struct fddi_header *fh;
387 struct mbuf *m;
388{
389 register struct ifqueue *inq;
390 register struct llc *l;
355 return (error);
356
357bad:
358 if (m)
359 m_freem(m);
360 return (error);
361}
362

--- 5 unchanged lines hidden (view full) ---

368void
369fddi_input(ifp, fh, m)
370 struct ifnet *ifp;
371 register struct fddi_header *fh;
372 struct mbuf *m;
373{
374 register struct ifqueue *inq;
375 register struct llc *l;
391 int s;
392
393 if ((ifp->if_flags & IFF_UP) == 0) {
394 m_freem(m);
395 return;
396 }
397 getmicrotime(&ifp->if_lastchange);
398 ifp->if_ibytes += m->m_pkthdr.len + sizeof (*fh);
399 if (fh->fddi_dhost[0] & 1) {

--- 115 unchanged lines hidden (view full) ---

515 default:
516 /* printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); */
517 ifp->if_noproto++;
518 dropanyway:
519 m_freem(m);
520 return;
521 }
522
376
377 if ((ifp->if_flags & IFF_UP) == 0) {
378 m_freem(m);
379 return;
380 }
381 getmicrotime(&ifp->if_lastchange);
382 ifp->if_ibytes += m->m_pkthdr.len + sizeof (*fh);
383 if (fh->fddi_dhost[0] & 1) {

--- 115 unchanged lines hidden (view full) ---

499 default:
500 /* printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); */
501 ifp->if_noproto++;
502 dropanyway:
503 m_freem(m);
504 return;
505 }
506
523 s = splimp();
524 if (IF_QFULL(inq)) {
525 IF_DROP(inq);
526 m_freem(m);
527 } else
528 IF_ENQUEUE(inq, m);
529 splx(s);
507 (void) IF_HANDOFF(inq, m, NULL);
530}
531/*
532 * Perform common duties while attaching to interface list
533 */
534#ifdef __NetBSD__
535#define ifa_next ifa_list.tqe_next
536#endif
537

--- 122 unchanged lines hidden ---
508}
509/*
510 * Perform common duties while attaching to interface list
511 */
512#ifdef __NetBSD__
513#define ifa_next ifa_list.tqe_next
514#endif
515

--- 122 unchanged lines hidden ---