Skip site navigation (1)Skip section navigation (2)
Date:      19 Jul 2000 13:04:39 -0000
From:      "Peter Pentchev" <roam@orbitel.bg>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/20033: 'constify' MFC of sys/net/ethernet.h breaks RELENG_4's buildworld
Message-ID:  <20000719130439.1509.qmail@ringwraith.oblivion.bg>

next in thread | raw e-mail | index | archive | help

>Number:         20033
>Category:       bin
>Synopsis:       'constify' MFC of sys/net/ethernet.h breaks RELENG_4's buildworld
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 19 06:10:04 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Peter Pentchev
>Release:        FreeBSD 4.1-RC i386
>Organization:
Orbitel JSCo
>Environment:

FreeBSD 4.1-RC #1: Tue Jul 18 11:37:54 EEST 2000
root@ringwraith.oblivion.bg:/usr/obj/usr/src/sys/BEL-4  i386

>Description:

In short, buildworld breaks due to a 'char *' -> 'const char *' mismatch.

   1.12.2.3 Wed Jul 19 1:40:14 2000 UTC by archie
   Branch: RELENG_4
   Diffs to 1.12.2.2 ; Diffs to 1.16
   MFC: const'ify parameters to ethers(3) routines.

This was the commit message of Archie Cobbs's recent MFC.  Unfortunately,
there are several programs in the 'world', which do not quite depend on
net/ethernet.h to provide function prototypes, providing them themselves
instead.  With the char * -> const char * change, these are doomed.

The files in question are:
  contrib/libpcap/nametoaddr.c        - for ether_hostton()
  contrib/ipfilter/iplang/iplang_y.y  - for ether_aton()
  usr.sbin/wlconfig/wlconfig.c        - for ether_aton()

This poses a problem - wlconfig's OK, but the other two are pieces of
contributed software, and any changes would have to be local to FreeBSD.

The 'high' priority is due to the upcoming 4.1-RELEASE.

>How-To-Repeat:

cvsup to RELENG_4 as of 2000/07/19, make buildworld, watch sky fall.

>Fix:

The way I see it, there are three paths to choose from:
- back out the constify commit;
- apply patch below, introducing local changes to libpcap and ipfilter;
- send patches to libpcap and ipfilter teams, requesting special treatment
  for FreeBSD.

The second and the third option might also warrand a __FreeBSD_version bump
to mark the constify spot; or maybe not - 410000 might be bump enough.

Anyway, as a quick-and-dirty fix/workaround, here goes:

--- src/contrib/libpcap/nametoaddr.c	Wed Jul 19 15:39:05 2000
+++ mysrc/contrib/libpcap/nametoaddr.c	Wed Jul 19 14:27:57 2000
@@ -367,7 +367,7 @@
 #else
 
 #if !defined(sgi) && !defined(__NetBSD__)
-extern int ether_hostton(char *, struct ether_addr *);
+extern int ether_hostton(const char *, struct ether_addr *);
 #endif
 
 /* Use the os supplied routines */
--- src/contrib/ipfilter/iplang/iplang_y.y	Wed Jul 19 15:42:23 2000
+++ mysrc/contrib/ipfilter/iplang/iplang_y.y	Wed Jul 19 14:50:20 2000
@@ -49,7 +49,7 @@
 #include "iplang.h"
 
 #ifndef __NetBSD__
-extern	struct ether_addr *ether_aton __P((char *));
+extern	struct ether_addr *ether_aton __P((const char *));
 #endif
 
 extern	int	opts;
--- src/usr.sbin/wlconfig/wlconfig.c	Wed Jul 19 15:43:30 2000
+++ mysrc/usr.sbin/wlconfig/wlconfig.c	Wed Jul 19 15:09:27 2000
@@ -69,7 +69,7 @@
 #include <net/if.h>
 #include <netinet/in.h>
 #include <netinet/if_ether.h>
-extern struct ether_addr *ether_aton(char *a);
+extern struct ether_addr *ether_aton(const char *a);
 
 #include <err.h>
 #include <stdio.h>

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000719130439.1509.qmail>