summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2002-03-29 09:52:01 +0000
committermdodd <mdodd@FreeBSD.org>2002-03-29 09:52:01 +0000
commita882d0fab85fcfa9bcb85b2c7a1e5e8fefab295a (patch)
tree8d30741a199860003411f8185168a2eb44267df8 /sys/net
parent30596ea411396257fa88c1ba871e6b4810154d45 (diff)
downloadFreeBSD-src-a882d0fab85fcfa9bcb85b2c7a1e5e8fefab295a.zip
FreeBSD-src-a882d0fab85fcfa9bcb85b2c7a1e5e8fefab295a.tar.gz
- Whitespace changes.
- Formatting. - Use macro, not magic numbers. - Move a dropanyway label in fddi_input() to end of function.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_fddisubr.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index 61d7c57..7100fc5 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -300,6 +300,7 @@ fddi_output(ifp, m, dst, rt0)
else
bcopy((caddr_t)ac->ac_enaddr, (caddr_t)fh->fddi_shost,
FDDI_ADDR_LEN);
+
/*
* If a simplex interface, and the packet is being sent to our
* Ethernet address or a broadcast address, loopback a copy.
@@ -309,8 +310,7 @@ fddi_output(ifp, m, dst, rt0)
* on the wire). However, we don't do that here for security
* reasons and compatibility with the original behavior.
*/
- if ((ifp->if_flags & IFF_SIMPLEX) &&
- (loop_copy != -1)) {
+ if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1)) {
if ((m->m_flags & M_BCAST) || loop_copy) {
struct mbuf *n = m_copy(m, 0, (int)M_COPYALL);
@@ -379,6 +379,7 @@ fddi_input(ifp, fh, m)
#endif
l = mtod(m, struct llc *);
+
switch (l->llc_dsap) {
#if defined(INET) || defined(INET6) || defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK)
case LLC_SNAP_LSAP:
@@ -404,10 +405,14 @@ fddi_input(ifp, fh, m)
return;
}
#endif /* NETATALK */
- if (l->llc_snap.org_code[0] != 0 || l->llc_snap.org_code[1] != 0|| l->llc_snap.org_code[2] != 0)
+ if (l->llc_snap.org_code[0] != 0 ||
+ l->llc_snap.org_code[1] != 0 ||
+ l->llc_snap.org_code[2] != 0)
goto dropanyway;
+
type = ntohs(l->llc_snap.ether_type);
- m_adj(m, 8);
+ m_adj(m, LLC_SNAPFRAMELEN);
+
switch (type) {
#ifdef INET
case ETHERTYPE_IP:
@@ -470,17 +475,21 @@ fddi_input(ifp, fh, m)
default:
/* printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); */
ifp->if_noproto++;
- dropanyway:
- m_freem(m);
- return;
+ goto dropanyway;
}
(void) IF_HANDOFF(inq, m, NULL);
+ return;
+
+dropanyway:
+ ifp->if_iqdrops++;
+ if (m)
+ m_freem(m);
+ return;
}
/*
* Perform common duties while attaching to interface list
*/
-
void
fddi_ifattach(ifp)
struct ifnet *ifp;
OpenPOWER on IntegriCloud