NetBSD Problem Report #10530
Received: (qmail 2662 invoked from network); 7 Jul 2000 22:23:11 -0000
Message-Id: <200007072212.e67MCLn00370@sheep.simplex.nl>
Date: Sat, 8 Jul 2000 00:12:21 +0200 (MEST)
From: onno@simplex.nl
Reply-To: o.vd.linden@quicknet.nl
To: gnats-bugs@gnats.netbsd.org
Subject: no IEEE802 support for DHCP in the kernel
X-Send-Pr-Version: 3.95
>Number: 10530
>Category: kern
>Synopsis: no IEEE802 support for DHCP in the kernel
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jul 07 22:24:00 +0000 2000
>Closed-Date:
>Last-Modified: Sat Apr 05 22:39:25 +0000 2003
>Originator: Onno van der Linden
>Release: 1.5_ALPHA
>Organization:
>Environment:
System: NetBSD sheep 1.5_ALPHA NetBSD 1.5_ALPHA (SHEEP) #15: Fri Jul 7 22:14:13 MEST 2000 onno@sheep:/usr/src/sys/arch/i386/compile/SHEEP i386
>Description:
dhcp (both client and server) doesn't work on token-ring because
support for it is missing in /sys/net/bpf.c (IEEE802 case) and
if_tokensubr.c (AF_LINK en pseudo_AF_HDRCMPLT cases)
>How-To-Repeat:
run the client or server on tr0
>Fix:
The diff below fixes the kernel side of things. Another PR will be
filed for a couple of problems in dhcp itself regarding token-ring.
*** /usr/src/sys/net/bpf.c.orig Mon May 29 12:14:06 2000
--- /usr/src/sys/net/bpf.c Sun Jul 2 13:07:35 2000
***************
*** 74,77 ****
--- 74,78 ----
#include <net/if_arc.h>
#include <net/if_ether.h>
+ #include <net/if_token.h>
#include <netinet/in.h>
***************
*** 161,164 ****
--- 162,171 ----
hlen = ARC_HDRLEN;
align = 5;
+ break;
+
+ case DLT_IEEE802:
+ sockp->sa_family = AF_LINK;
+ hlen = sizeof(struct token_header);
+ align = 2;
break;
*** /usr/src/sys/net/if_tokensubr.c.orig Wed Jun 14 12:12:01 2000
--- /usr/src/sys/net/if_tokensubr.c Sun Jul 2 14:42:09 2000
***************
*** 2,6 ****
/*
! * Copyright (c) 1997-1999
* Onno van der Linden
* Copyright (c) 1995
--- 2,6 ----
/*
! * Copyright (c) 1997-2000
* Onno van der Linden
* Copyright (c) 1995
***************
*** 105,109 ****
* need sockaddr_dl_8025 to handle this correctly
* IPX cases
- * handle "fast" forwarding like if_ether and if_fddi
*/
--- 105,108 ----
***************
*** 145,150 ****
{
u_int16_t etype;
! int s, error = 0;
u_char edst[ISO88025_ADDR_LEN];
struct mbuf *m = m0;
struct rtentry *rt;
--- 144,150 ----
{
u_int16_t etype;
! int s, error = 0, hdrcmplt = 0;
u_char edst[ISO88025_ADDR_LEN];
+ u_char esrc[ISO88025_ADDR_LEN];
struct mbuf *m = m0;
struct rtentry *rt;
***************
*** 394,397 ****
--- 394,415 ----
}
+ case pseudo_AF_HDRCMPLT:
+ {
+ struct token_header *th = (struct token_header *)dst->sa_data;
+ hdrcmplt = 1;
+ bcopy((caddr_t)th->token_shost, (caddr_t)esrc, sizeof (esrc));
+ /*FALLTHROUGH*/
+ }
+
+ case AF_LINK:
+ {
+ struct token_header *th = (struct token_header *)dst->sa_data;
+ bcopy((caddr_t)th->token_dhost, (caddr_t)edst, sizeof (edst));
+ if (*edst & 1)
+ m->m_flags |= (M_BCAST|M_MCAST);
+ etype = 0;
+ break;
+ }
+
default:
printf("%s: can't handle af%d\n", ifp->if_xname,
***************
*** 429,434 ****
trh->token_fc = TOKEN_FC;
bcopy((caddr_t)edst, (caddr_t)trh->token_dhost, sizeof (edst));
! bcopy(LLADDR(ifp->if_sadl), (caddr_t)trh->token_shost,
! sizeof(trh->token_shost));
if (riflen != 0) {
--- 447,456 ----
trh->token_fc = TOKEN_FC;
bcopy((caddr_t)edst, (caddr_t)trh->token_dhost, sizeof (edst));
! if (hdrcmplt)
! bcopy((caddr_t)esrc, (caddr_t)trh->token_shost,
! sizeof(trh->token_shost));
! else
! bcopy(LLADDR(ifp->if_sadl), (caddr_t)trh->token_shost,
! sizeof(trh->token_shost));
if (riflen != 0) {
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->mjl
Responsible-Changed-By: perry
Responsible-Changed-When: Sat Apr 5 13:08:53 PST 2003
Responsible-Changed-Why:
mjl was the last person to do significant token ring work.
Responsible-Changed-From-To: mjl->kern-bug-people
Responsible-Changed-By: mjl
Responsible-Changed-When: Sat Apr 5 14:38:28 PST 2003
Responsible-Changed-Why:
I no longer have access to any token ring hardware.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.