Deleted Added
full compact
if_fddisubr.c (111790) if_fddisubr.c (111888)
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 111790 2003-03-03 05:04:57Z mdodd $
36 * $FreeBSD: head/sys/net/if_fddisubr.c 111888 2003-03-04 23:19:55Z jlemon $
37 */
38
39#include "opt_atalk.h"
40#include "opt_inet.h"
41#include "opt_inet6.h"
42#include "opt_ipx.h"
43#include "opt_mac.h"
44

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

340 * the packet is in the mbuf chain m without
341 * the fddi header, which is provided separately.
342 */
343static void
344fddi_input(ifp, m)
345 struct ifnet *ifp;
346 struct mbuf *m;
347{
37 */
38
39#include "opt_atalk.h"
40#include "opt_inet.h"
41#include "opt_inet6.h"
42#include "opt_ipx.h"
43#include "opt_mac.h"
44

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

340 * the packet is in the mbuf chain m without
341 * the fddi header, which is provided separately.
342 */
343static void
344fddi_input(ifp, m)
345 struct ifnet *ifp;
346 struct mbuf *m;
347{
348 struct ifqueue *inq;
348 int isr;
349 struct llc *l;
350 struct fddi_header *fh;
351
352 fh = mtod(m, struct fddi_header *);
353
354 /*
355 * Update interface statistics.
356 */

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

413 {
414 u_int16_t type;
415 if (l->llc_control != LLC_UI || l->llc_ssap != LLC_SNAP_LSAP) {
416 ifp->if_noproto++;
417 goto dropanyway;
418 }
419#ifdef NETATALK
420 if (Bcmp(&(l->llc_snap.org_code)[0], at_org_code,
349 struct llc *l;
350 struct fddi_header *fh;
351
352 fh = mtod(m, struct fddi_header *);
353
354 /*
355 * Update interface statistics.
356 */

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

413 {
414 u_int16_t type;
415 if (l->llc_control != LLC_UI || l->llc_ssap != LLC_SNAP_LSAP) {
416 ifp->if_noproto++;
417 goto dropanyway;
418 }
419#ifdef NETATALK
420 if (Bcmp(&(l->llc_snap.org_code)[0], at_org_code,
421 sizeof(at_org_code)) == 0 &&
422 ntohs(l->llc_snap.ether_type) == ETHERTYPE_AT) {
423 inq = &atintrq2;
424 m_adj(m, LLC_SNAPFRAMELEN);
425 schednetisr(NETISR_ATALK);
426 break;
421 sizeof(at_org_code)) == 0 &&
422 ntohs(l->llc_snap.ether_type) == ETHERTYPE_AT) {
423 isr = NETISR_ATALK2;
424 m_adj(m, LLC_SNAPFRAMELEN);
425 break;
427 }
428
429 if (Bcmp(&(l->llc_snap.org_code)[0], aarp_org_code,
426 }
427
428 if (Bcmp(&(l->llc_snap.org_code)[0], aarp_org_code,
430 sizeof(aarp_org_code)) == 0 &&
431 ntohs(l->llc_snap.ether_type) == ETHERTYPE_AARP) {
432 m_adj(m, LLC_SNAPFRAMELEN);
433 aarpinput(IFP2AC(ifp), m); /* XXX */
434 return;
429 sizeof(aarp_org_code)) == 0 &&
430 ntohs(l->llc_snap.ether_type) == ETHERTYPE_AARP) {
431 m_adj(m, LLC_SNAPFRAMELEN);
432 isr = NETISR_AARP;
433 break;
435 }
436#endif /* NETATALK */
437 if (l->llc_snap.org_code[0] != 0 ||
438 l->llc_snap.org_code[1] != 0 ||
439 l->llc_snap.org_code[2] != 0) {
440 ifp->if_noproto++;
441 goto dropanyway;
442 }
443
444 type = ntohs(l->llc_snap.ether_type);
445 m_adj(m, LLC_SNAPFRAMELEN);
446
447 switch (type) {
448#ifdef INET
449 case ETHERTYPE_IP:
450 if (ipflow_fastforward(m))
451 return;
434 }
435#endif /* NETATALK */
436 if (l->llc_snap.org_code[0] != 0 ||
437 l->llc_snap.org_code[1] != 0 ||
438 l->llc_snap.org_code[2] != 0) {
439 ifp->if_noproto++;
440 goto dropanyway;
441 }
442
443 type = ntohs(l->llc_snap.ether_type);
444 m_adj(m, LLC_SNAPFRAMELEN);
445
446 switch (type) {
447#ifdef INET
448 case ETHERTYPE_IP:
449 if (ipflow_fastforward(m))
450 return;
452 schednetisr(NETISR_IP);
453 inq = &ipintrq;
451 isr = NETISR_IP;
454 break;
455
456 case ETHERTYPE_ARP:
457 if (ifp->if_flags & IFF_NOARP)
458 goto dropanyway;
452 break;
453
454 case ETHERTYPE_ARP:
455 if (ifp->if_flags & IFF_NOARP)
456 goto dropanyway;
459 schednetisr(NETISR_ARP);
460 inq = &arpintrq;
457 isr = NETISR_ARP;
461 break;
462#endif
463#ifdef INET6
464 case ETHERTYPE_IPV6:
458 break;
459#endif
460#ifdef INET6
461 case ETHERTYPE_IPV6:
465 schednetisr(NETISR_IPV6);
466 inq = &ip6intrq;
462 isr = NETISR_IPV6;
467 break;
468#endif
469#ifdef IPX
470 case ETHERTYPE_IPX:
463 break;
464#endif
465#ifdef IPX
466 case ETHERTYPE_IPX:
471 schednetisr(NETISR_IPX);
472 inq = &ipxintrq;
467 isr = NETISR_IPX;
473 break;
474#endif
475#ifdef NS
476 case ETHERTYPE_NS:
468 break;
469#endif
470#ifdef NS
471 case ETHERTYPE_NS:
477 schednetisr(NETISR_NS);
478 inq = &nsintrq;
472 isr = NETISR_NS;
479 break;
480#endif
481#ifdef DECNET
482 case ETHERTYPE_DECNET:
473 break;
474#endif
475#ifdef DECNET
476 case ETHERTYPE_DECNET:
483 schednetisr(NETISR_DECNET);
484 inq = &decnetintrq;
477 isr = NETISR_DECNET;
485 break;
486#endif
487#ifdef NETATALK
488 case ETHERTYPE_AT:
478 break;
479#endif
480#ifdef NETATALK
481 case ETHERTYPE_AT:
489 schednetisr(NETISR_ATALK);
490 inq = &atintrq1;
482 isr = NETISR_ATALK1;
491 break;
492 case ETHERTYPE_AARP:
483 break;
484 case ETHERTYPE_AARP:
493 /* probably this should be done with a NETISR as well */
494 aarpinput(IFP2AC(ifp), m); /* XXX */
495 return;
485 isr = NETISR_AARP;
486 break;
496#endif /* NETATALK */
497 default:
498 /* printf("fddi_input: unknown protocol 0x%x\n", type); */
499 ifp->if_noproto++;
500 goto dropanyway;
501 }
502 break;
503 }
504
505 default:
506 /* printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); */
507 ifp->if_noproto++;
508 goto dropanyway;
509 }
487#endif /* NETATALK */
488 default:
489 /* printf("fddi_input: unknown protocol 0x%x\n", type); */
490 ifp->if_noproto++;
491 goto dropanyway;
492 }
493 break;
494 }
495
496 default:
497 /* printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); */
498 ifp->if_noproto++;
499 goto dropanyway;
500 }
510
511 (void) IF_HANDOFF(inq, m, NULL);
501 netisr_dispatch(isr, m);
512 return;
513
514dropanyway:
515 ifp->if_iqdrops++;
516 if (m)
517 m_freem(m);
518 return;
519}

--- 234 unchanged lines hidden ---
502 return;
503
504dropanyway:
505 ifp->if_iqdrops++;
506 if (m)
507 m_freem(m);
508 return;
509}

--- 234 unchanged lines hidden ---