From owner-freebsd-isdn Fri Sep 1 4:15:33 2000 Delivered-To: freebsd-isdn@freebsd.org Received: from mail2.netcologne.de (mail2.netcologne.de [194.8.194.103]) by hub.freebsd.org (Postfix) with ESMTP id AEA0537B422 for ; Fri, 1 Sep 2000 04:15:30 -0700 (PDT) Received: from bagabeedaboo.security.at12.de (dial-213-168-64-160.netcologne.de [213.168.64.160]) by mail2.netcologne.de (8.9.3/8.9.3) with ESMTP id NAA08438 for ; Fri, 1 Sep 2000 13:15:28 +0200 (MET DST) Received: from localhost (localhost.security.at12.de [127.0.0.1]) by bagabeedaboo.security.at12.de (8.10.2/8.10.2) with ESMTP id e81BFJQ00446 for ; Fri, 1 Sep 2000 13:15:19 +0200 (CEST) Date: Fri, 1 Sep 2000 13:15:18 +0200 (CEST) From: Paul Herman To: freebsd-isdn@FreeBSD.ORG Subject: No "RANDOMDEV" breaks i4b Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-isdn@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hello isdn-ers, If you compile a kernel without the option "RANDOMDEV" i4b fails to compile. I'm using FreeBSD -CURRENT from Aug 31. Here is a patch which allows i4b to compile even if RANDOMDEV is not configured. It works, but I personally don't like the hardcoded 0xffff stuff; maybe the patch could use some cute "sizeof()" tricks... BTW, this doesn't use the kld randomdev.ko. Anybody know an easy way to incorporate that? -Paul. -------------------------------------------------------- --- layer2/i4b_tei.c.orig Fri Sep 1 12:39:28 2000 +++ layer2/i4b_tei.c Fri Sep 1 12:41:07 2000 @@ -292,5 +292,9 @@ u_short val; +#ifdef RANDOMDEV read_random((char *)&val, sizeof(val)); +#else + val = random() & 0xffff; +#endif #else --- layer4/i4b_l4mgmt.c.orig Fri Sep 1 12:42:02 2000 +++ layer4/i4b_l4mgmt.c Fri Sep 1 12:42:42 2000 @@ -270,5 +270,9 @@ #if defined(__FreeBSD__) +#ifdef RANDOMDEV read_random((char *)&val, sizeof(val)); +#else + val = random() & 0xff; +#endif #else val |= unit+i; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isdn" in the body of the message