]> git.saurik.com Git - apple/xnu.git/blob - bsd/net/if_fddisubr.c
ab5af74540fd8837dc145f5d5b865f5bb78cb61d
[apple/xnu.git] / bsd / net / if_fddisubr.c
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * Copyright (c) 1995, 1996
25 * Matt Thomas <matt@3am-software.com>. All rights reserved.
26 * Copyright (c) 1982, 1989, 1993
27 * The Regents of the University of California. All rights reserved.
28 *
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
32 * 1. Redistributions of source code must retain the above copyright
33 * notice, this list of conditions and the following disclaimer.
34 * 2. Redistributions in binary form must reproduce the above copyright
35 * notice, this list of conditions and the following disclaimer in the
36 * documentation and/or other materials provided with the distribution.
37 * 3. All advertising materials mentioning features or use of this software
38 * must display the following acknowledgement:
39 * This product includes software developed by the University of
40 * California, Berkeley and its contributors.
41 * 4. Neither the name of the University nor the names of its contributors
42 * may be used to endorse or promote products derived from this software
43 * without specific prior written permission.
44 *
45 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
46 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
47 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
49 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 * SUCH DAMAGE.
56 *
57 * from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp
58 */
59
60 #include "opt_atalk.h"
61 #include "opt_inet.h"
62 #include "opt_ipx.h"
63
64 #include <sys/param.h>
65 #include <sys/systm.h>
66 #include <sys/mbuf.h>
67 #include <sys/socket.h>
68
69 #include <net/if.h>
70 #include <net/netisr.h>
71 #include <net/route.h>
72 #include <net/if_llc.h>
73 #include <net/if_dl.h>
74 #include <net/if_types.h>
75
76 #if INET
77 #include <netinet/in.h>
78 #include <netinet/in_var.h>
79 #include <netinet/if_ether.h>
80 #endif
81 #if defined(__FreeBSD__)
82 #include <netinet/if_fddi.h>
83 #else
84 #include <net/if_fddi.h>
85 #endif
86
87 #if IPX
88 #include <netipx/ipx.h>
89 #include <netipx/ipx_if.h>
90 #endif
91
92 #if DECNET
93 #include <netdnet/dn.h>
94 #endif
95
96 #include "bpfilter.h"
97
98 #define senderr(e) { error = (e); goto bad;}
99
100 /*
101 * This really should be defined in if_llc.h but in case it isn't.
102 */
103 #ifndef llc_snap
104 #define llc_snap llc_un.type_snap
105 #endif
106
107 #if defined(__bsdi__) || defined(__NetBSD__)
108 #define RTALLOC1(a, b) rtalloc1(a, b)
109 #define ARPRESOLVE(a, b, c, d, e, f) arpresolve(a, b, c, d, e)
110 #elif defined(__FreeBSD__)
111 #define RTALLOC1(a, b) rtalloc1(a, b, 0UL)
112 #define ARPRESOLVE(a, b, c, d, e, f) arpresolve(a, b, c, d, e, f)
113 #endif
114 /*
115 * FDDI output routine.
116 * Encapsulate a packet of type family for the local net.
117 * Use trailer local net encapsulation if enough data in first
118 * packet leaves a multiple of 512 bytes of data in remainder.
119 * Assumes that ifp is actually pointer to arpcom structure.
120 */
121 int
122 fddi_output(ifp, m0, dst, rt0)
123 register struct ifnet *ifp;
124 struct mbuf *m0;
125 struct sockaddr *dst;
126 struct rtentry *rt0;
127 {
128 u_int16_t type;
129 int s, loop_copy = 0, error = 0;
130 u_char edst[6];
131 register struct mbuf *m = m0;
132 register struct rtentry *rt;
133 register struct fddi_header *fh;
134 struct arpcom *ac = (struct arpcom *)ifp;
135
136 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
137 senderr(ENETDOWN);
138 getmicrotime(&ifp->if_lastchange);
139 #if !defined(__bsdi__) || _BSDI_VERSION >= 199401
140 if (rt = rt0) {
141 if ((rt->rt_flags & RTF_UP) == 0) {
142 if (rt0 = rt = RTALLOC1(dst, 1))
143 rtunref(rt);
144 else
145 senderr(EHOSTUNREACH);
146 }
147 if (rt->rt_flags & RTF_GATEWAY) {
148 if (rt->rt_gwroute == 0)
149 goto lookup;
150 if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) {
151 rtfree(rt); rt = rt0;
152 lookup: rt->rt_gwroute = RTALLOC1(rt->rt_gateway, 1);
153 if ((rt = rt->rt_gwroute) == 0)
154 senderr(EHOSTUNREACH);
155 }
156 }
157 if (rt->rt_flags & RTF_REJECT)
158 if (rt->rt_rmx.rmx_expire == 0 ||
159 time_second < rt->rt_rmx.rmx_expire)
160 senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH);
161 }
162 #endif
163 switch (dst->sa_family) {
164
165 #if INET
166 case AF_INET: {
167 #if !defined(__bsdi__) || _BSDI_VERSION >= 199401
168 if (!ARPRESOLVE(ac, rt, m, dst, edst, rt0))
169 return (0); /* if not yet resolved */
170 #else
171 int usetrailers;
172 if (!arpresolve(ac, m, &((struct sockaddr_in *)dst)->sin_addr, edst, &usetrailers))
173 return (0); /* if not yet resolved */
174 #endif
175 type = htons(ETHERTYPE_IP);
176 break;
177 }
178 #endif
179 #if IPX
180 case AF_IPX:
181 type = htons(ETHERTYPE_IPX);
182 bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
183 (caddr_t)edst, sizeof (edst));
184 break;
185 #endif
186
187 #if NS
188 case AF_NS:
189 type = htons(ETHERTYPE_NS);
190 bcopy((caddr_t)&(((struct sockaddr_ns *)dst)->sns_addr.x_host),
191 (caddr_t)edst, sizeof (edst));
192 break;
193 #endif
194 #if ISO
195 case AF_ISO: {
196 int snpalen;
197 struct llc *l;
198 register struct sockaddr_dl *sdl;
199
200 if (rt && (sdl = (struct sockaddr_dl *)rt->rt_gateway) &&
201 sdl->sdl_family == AF_LINK && sdl->sdl_alen > 0) {
202 bcopy(LLADDR(sdl), (caddr_t)edst, sizeof(edst));
203 } else if (error =
204 iso_snparesolve(ifp, (struct sockaddr_iso *)dst,
205 (char *)edst, &snpalen))
206 goto bad; /* Not Resolved */
207 /* If broadcasting on a simplex interface, loopback a copy */
208 if (*edst & 1)
209 m->m_flags |= (M_BCAST|M_MCAST);
210 M_PREPEND(m, 3, M_DONTWAIT);
211 if (m == NULL)
212 return (0);
213 type = 0;
214 l = mtod(m, struct llc *);
215 l->llc_dsap = l->llc_ssap = LLC_ISO_LSAP;
216 l->llc_control = LLC_UI;
217 IFDEBUG(D_ETHER)
218 int i;
219 printf("unoutput: sending pkt to: ");
220 for (i=0; i<6; i++)
221 printf("%x ", edst[i] & 0xff);
222 printf("\n");
223 ENDDEBUG
224 } break;
225 #endif /* ISO */
226 #if LLC
227 /* case AF_NSAP: */
228 case AF_CCITT: {
229 register struct sockaddr_dl *sdl =
230 (struct sockaddr_dl *) rt -> rt_gateway;
231
232 if (sdl && sdl->sdl_family != AF_LINK && sdl->sdl_alen <= 0)
233 goto bad; /* Not a link interface ? Funny ... */
234 bcopy(LLADDR(sdl), (char *)edst, sizeof(edst));
235 if (*edst & 1)
236 loop_copy = 1;
237 type = 0;
238 #if LLC_DEBUG
239 {
240 int i;
241 register struct llc *l = mtod(m, struct llc *);
242
243 printf("fddi_output: sending LLC2 pkt to: ");
244 for (i=0; i<6; i++)
245 printf("%x ", edst[i] & 0xff);
246 printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n",
247 type & 0xff, l->llc_dsap & 0xff, l->llc_ssap &0xff,
248 l->llc_control & 0xff);
249
250 }
251 #endif /* LLC_DEBUG */
252 } break;
253 #endif /* LLC */
254
255 case AF_UNSPEC:
256 {
257 struct ether_header *eh;
258 loop_copy = -1;
259 eh = (struct ether_header *)dst->sa_data;
260 (void)memcpy((caddr_t)edst, (caddr_t)eh->ether_dhost, sizeof (edst));
261 if (*edst & 1)
262 m->m_flags |= (M_BCAST|M_MCAST);
263 type = eh->ether_type;
264 break;
265 }
266
267 #if NBPFILTER > 0
268 case AF_IMPLINK:
269 {
270 fh = mtod(m, struct fddi_header *);
271 error = EPROTONOSUPPORT;
272 switch (fh->fddi_fc & (FDDIFC_C|FDDIFC_L|FDDIFC_F)) {
273 case FDDIFC_LLC_ASYNC: {
274 /* legal priorities are 0 through 7 */
275 if ((fh->fddi_fc & FDDIFC_Z) > 7)
276 goto bad;
277 break;
278 }
279 case FDDIFC_LLC_SYNC: {
280 /* FDDIFC_Z bits reserved, must be zero */
281 if (fh->fddi_fc & FDDIFC_Z)
282 goto bad;
283 break;
284 }
285 case FDDIFC_SMT: {
286 /* FDDIFC_Z bits must be non zero */
287 if ((fh->fddi_fc & FDDIFC_Z) == 0)
288 goto bad;
289 break;
290 }
291 default: {
292 /* anything else is too dangerous */
293 goto bad;
294 }
295 }
296 error = 0;
297 if (fh->fddi_dhost[0] & 1)
298 m->m_flags |= (M_BCAST|M_MCAST);
299 goto queue_it;
300 }
301 #endif
302 default:
303 printf("%s%d: can't handle af%d\n", ifp->if_name, ifp->if_unit,
304 dst->sa_family);
305 senderr(EAFNOSUPPORT);
306 }
307
308 if (type != 0) {
309 register struct llc *l;
310 M_PREPEND(m, sizeof (struct llc), M_DONTWAIT);
311 if (m == 0)
312 senderr(ENOBUFS);
313 l = mtod(m, struct llc *);
314 l->llc_control = LLC_UI;
315 l->llc_dsap = l->llc_ssap = LLC_SNAP_LSAP;
316 l->llc_snap.org_code[0] = l->llc_snap.org_code[1] = l->llc_snap.org_code[2] = 0;
317 (void)memcpy((caddr_t) &l->llc_snap.ether_type, (caddr_t) &type,
318 sizeof(u_int16_t));
319 }
320
321 /*
322 * Add local net header. If no space in first mbuf,
323 * allocate another.
324 */
325 M_PREPEND(m, sizeof (struct fddi_header), M_DONTWAIT);
326 if (m == 0)
327 senderr(ENOBUFS);
328 fh = mtod(m, struct fddi_header *);
329 fh->fddi_fc = FDDIFC_LLC_ASYNC|FDDIFC_LLC_PRIO4;
330 (void)memcpy((caddr_t)fh->fddi_dhost, (caddr_t)edst, sizeof (edst));
331 queue_it:
332 (void)memcpy((caddr_t)fh->fddi_shost, (caddr_t)ac->ac_enaddr,
333 sizeof(fh->fddi_shost));
334
335 /*
336 * If a simplex interface, and the packet is being sent to our
337 * Ethernet address or a broadcast address, loopback a copy.
338 * XXX To make a simplex device behave exactly like a duplex
339 * device, we should copy in the case of sending to our own
340 * ethernet address (thus letting the original actually appear
341 * on the wire). However, we don't do that here for security
342 * reasons and compatibility with the original behavior.
343 */
344 if ((ifp->if_flags & IFF_SIMPLEX) &&
345 (loop_copy != -1)) {
346 if ((m->m_flags & M_BCAST) || loop_copy) {
347 struct mbuf *n = m_copy(m, 0, (int)M_COPYALL);
348
349 (void) if_simloop(ifp,
350 n, dst, sizeof(struct fddi_header));
351 } else if (bcmp(fh->fddi_dhost,
352 fh->fddi_shost, sizeof(fh->fddi_shost)) == 0) {
353 (void) if_simloop(ifp,
354 m, dst, sizeof(struct fddi_header));
355 return(0); /* XXX */
356 }
357 }
358
359 s = splimp();
360 /*
361 * Queue message on interface, and start output if interface
362 * not yet active.
363 */
364 if (IF_QFULL(&ifp->if_snd)) {
365 IF_DROP(&ifp->if_snd);
366 splx(s);
367 senderr(ENOBUFS);
368 }
369 ifp->if_obytes += m->m_pkthdr.len;
370 IF_ENQUEUE(&ifp->if_snd, m);
371 if ((ifp->if_flags & IFF_OACTIVE) == 0)
372 (*ifp->if_start)(ifp);
373 splx(s);
374 if (m->m_flags & M_MCAST)
375 ifp->if_omcasts++;
376 return (error);
377
378 bad:
379 if (m)
380 m_freem(m);
381 return (error);
382 }
383
384 /*
385 * Process a received FDDI packet;
386 * the packet is in the mbuf chain m without
387 * the fddi header, which is provided separately.
388 */
389 void
390 fddi_input(ifp, fh, m)
391 struct ifnet *ifp;
392 register struct fddi_header *fh;
393 struct mbuf *m;
394 {
395 register struct ifqueue *inq;
396 register struct llc *l;
397 int s;
398
399 if ((ifp->if_flags & IFF_UP) == 0) {
400 m_freem(m);
401 return;
402 }
403 getmicrotime(&ifp->if_lastchange);
404 ifp->if_ibytes += m->m_pkthdr.len + sizeof (*fh);
405 if (fh->fddi_dhost[0] & 1) {
406 if (bcmp((caddr_t)fddibroadcastaddr, (caddr_t)fh->fddi_dhost,
407 sizeof(fddibroadcastaddr)) == 0)
408 m->m_flags |= M_BCAST;
409 else
410 m->m_flags |= M_MCAST;
411 ifp->if_imcasts++;
412 } else if ((ifp->if_flags & IFF_PROMISC)
413 && bcmp(((struct arpcom *)ifp)->ac_enaddr, (caddr_t)fh->fddi_dhost,
414 sizeof(fh->fddi_dhost)) != 0) {
415 m_freem(m);
416 return;
417 }
418
419 #ifdef M_LINK0
420 /*
421 * If this has a LLC priority of 0, then mark it so upper
422 * layers have a hint that it really came via a FDDI/Ethernet
423 * bridge.
424 */
425 if ((fh->fddi_fc & FDDIFC_LLC_PRIO7) == FDDIFC_LLC_PRIO0)
426 m->m_flags |= M_LINK0;
427 #endif
428
429 l = mtod(m, struct llc *);
430 switch (l->llc_dsap) {
431 #if defined(INET) || NS || IPX || defined(NETATALK)
432 case LLC_SNAP_LSAP:
433 {
434 u_int16_t type;
435 if (l->llc_control != LLC_UI || l->llc_ssap != LLC_SNAP_LSAP)
436 goto dropanyway;
437
438 if (l->llc_snap.org_code[0] != 0 || l->llc_snap.org_code[1] != 0|| l->llc_snap.org_code[2] != 0)
439 goto dropanyway;
440 type = ntohs(l->llc_snap.ether_type);
441 m_adj(m, 8);
442 switch (type) {
443 #if INET
444 case ETHERTYPE_IP:
445 if (ipflow_fastforward(m))
446 return;
447 schednetisr(NETISR_IP);
448 inq = &ipintrq;
449 break;
450
451 case ETHERTYPE_ARP:
452 #if !defined(__bsdi__) || _BSDI_VERSION >= 199401
453 schednetisr(NETISR_ARP);
454 inq = &arpintrq;
455 break;
456 #else
457 arpinput((struct arpcom *)ifp, m);
458 return;
459 #endif
460 #endif
461 #if IPX
462 case ETHERTYPE_IPX:
463 schednetisr(NETISR_IPX);
464 inq = &ipxintrq;
465 break;
466 #endif
467 #if NS
468 case ETHERTYPE_NS:
469 schednetisr(NETISR_NS);
470 inq = &nsintrq;
471 break;
472 #endif
473 #if DECNET
474 case ETHERTYPE_DECNET:
475 schednetisr(NETISR_DECNET);
476 inq = &decnetintrq;
477 break;
478 #endif
479
480 default:
481 /* printf("fddi_input: unknown protocol 0x%x\n", type); */
482 ifp->if_noproto++;
483 goto dropanyway;
484 }
485 break;
486 }
487 #endif /* INET || NS */
488 #if ISO
489 case LLC_ISO_LSAP:
490 switch (l->llc_control) {
491 case LLC_UI:
492 /* LLC_UI_P forbidden in class 1 service */
493 if ((l->llc_dsap == LLC_ISO_LSAP) &&
494 (l->llc_ssap == LLC_ISO_LSAP)) {
495 /* LSAP for ISO */
496 m->m_data += 3; /* XXX */
497 m->m_len -= 3; /* XXX */
498 m->m_pkthdr.len -= 3; /* XXX */
499 M_PREPEND(m, sizeof *fh, M_DONTWAIT);
500 if (m == 0)
501 return;
502 *mtod(m, struct fddi_header *) = *fh;
503 IFDEBUG(D_ETHER)
504 printf("clnp packet");
505 ENDDEBUG
506 schednetisr(NETISR_ISO);
507 inq = &clnlintrq;
508 break;
509 }
510 goto dropanyway;
511
512 case LLC_XID:
513 case LLC_XID_P:
514 if(m->m_len < 6)
515 goto dropanyway;
516 l->llc_window = 0;
517 l->llc_fid = 9;
518 l->llc_class = 1;
519 l->llc_dsap = l->llc_ssap = 0;
520 /* Fall through to */
521 case LLC_TEST:
522 case LLC_TEST_P:
523 {
524 struct sockaddr sa;
525 register struct ether_header *eh;
526 struct arpcom *ac = (struct arpcom *) ifp;
527 int i;
528 u_char c = l->llc_dsap;
529
530 l->llc_dsap = l->llc_ssap;
531 l->llc_ssap = c;
532 if (m->m_flags & (M_BCAST | M_MCAST))
533 bcopy((caddr_t)ac->ac_enaddr,
534 (caddr_t)eh->ether_dhost, 6);
535 sa.sa_family = AF_UNSPEC;
536 sa.sa_len = sizeof(sa);
537 eh = (struct ether_header *)sa.sa_data;
538 for (i = 0; i < 6; i++) {
539 eh->ether_shost[i] = fh->fddi_dhost[i];
540 eh->ether_dhost[i] = fh->fddi_shost[i];
541 }
542 eh->ether_type = 0;
543 ifp->if_output(ifp, m, &sa, NULL);
544 return;
545 }
546 default:
547 m_freem(m);
548 return;
549 }
550 break;
551 #endif /* ISO */
552 #if LLC
553 case LLC_X25_LSAP:
554 {
555 M_PREPEND(m, sizeof(struct sdl_hdr) , M_DONTWAIT);
556 if (m == 0)
557 return;
558 if ( !sdl_sethdrif(ifp, fh->fddi_shost, LLC_X25_LSAP,
559 fh->fddi_dhost, LLC_X25_LSAP, 6,
560 mtod(m, struct sdl_hdr *)))
561 panic("ETHER cons addr failure");
562 mtod(m, struct sdl_hdr *)->sdlhdr_len = m->m_pkthdr.len - sizeof(struct sdl_hdr);
563 #if LLC_DEBUG
564 printf("llc packet\n");
565 #endif /* LLC_DEBUG */
566 schednetisr(NETISR_CCITT);
567 inq = &llcintrq;
568 break;
569 }
570 #endif /* LLC */
571
572 default:
573 /* printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); */
574 ifp->if_noproto++;
575 dropanyway:
576 m_freem(m);
577 return;
578 }
579
580 s = splimp();
581 if (IF_QFULL(inq)) {
582 IF_DROP(inq);
583 m_freem(m);
584 } else
585 IF_ENQUEUE(inq, m);
586 splx(s);
587 }
588 /*
589 * Perform common duties while attaching to interface list
590 */
591 #ifdef __NetBSD__
592 #define ifa_next ifa_list.tqe_next
593 #endif
594
595 void
596 fddi_ifattach(ifp)
597 register struct ifnet *ifp;
598 {
599 register struct ifaddr *ifa;
600 register struct sockaddr_dl *sdl;
601
602 ifp->if_type = IFT_FDDI;
603 ifp->if_addrlen = 6;
604 ifp->if_hdrlen = 21;
605 ifp->if_mtu = FDDIMTU;
606 ifp->if_baudrate = 100000000;
607 #if IFF_NOTRAILERS
608 ifp->if_flags |= IFF_NOTRAILERS;
609 #endif
610 #if defined(__FreeBSD__)
611 ifa = ifnet_addrs[ifp->if_index - 1];
612 sdl = (struct sockaddr_dl *)ifa->ifa_addr;
613 sdl->sdl_type = IFT_FDDI;
614 sdl->sdl_alen = ifp->if_addrlen;
615 bcopy(((struct arpcom *)ifp)->ac_enaddr, LLADDR(sdl), ifp->if_addrlen);
616 #elif defined(__NetBSD__)
617 LIST_INIT(&((struct arpcom *)ifp)->ac_multiaddrs);
618 for (ifa = ifp->if_addrlist.tqh_first; ifa != NULL; ifa = ifa->ifa_list.tqe_next)
619 #else
620 for (ifa = ifp->if_addrlist; ifa != NULL; ifa = ifa->ifa_next)
621 #endif
622 #if !defined(__FreeBSD__)
623 if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&
624 sdl->sdl_family == AF_LINK) {
625 sdl->sdl_type = IFT_FDDI;
626 sdl->sdl_alen = ifp->if_addrlen;
627 bcopy((caddr_t)((struct arpcom *)ifp)->ac_enaddr,
628 LLADDR(sdl), ifp->if_addrlen);
629 break;
630 }
631 #endif
632 }