Bug 20033

Summary: 'constify' MFC of sys/net/ethernet.h breaks RELENG_4's buildworld
Product: Base System Reporter: Peter Pentchev <roam>
Component: binAssignee: Archie Cobbs <archie>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Peter Pentchev 2000-07-19 14:10:04 UTC
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.

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:
How-To-Repeat: 
cvsup to RELENG_4 as of 2000/07/19, make buildworld, watch sky fall.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-07-19 14:35:53 UTC
Responsible Changed
From-To: freebsd-bugs->archie

Breakage related to archie's commit.
Comment 2 Peter Pentchev 2000-07-19 14:45:01 UTC
Another, arguably much better, set of patches; the old ones were
severely affected by a caffeine defficiency.

These ones may even be sent to the libpcap and ipfilter teams -
there is no need to redeclare the ether_*() functions on FreeBSD.

G'luck,
Peter Pentchev

-- 
This would easier understand fewer had omitted.

--- src/contrib/libpcap/nametoaddr.c	Wed Jul 19 15:39:05 2000
+++ mysrc/contrib/libpcap/nametoaddr.c	Wed Jul 19 16:30:05 2000
@@ -366,7 +366,7 @@
 }
 #else
 
-#if !defined(sgi) && !defined(__NetBSD__)
+#if !defined(sgi) && !defined(__NetBSD__) && !defined(__FreeBSD__)
 extern int ether_hostton(char *, struct ether_addr *);
 #endif
 
--- src/contrib/ipfilter/iplang/iplang_y.y	Wed Jul 19 15:42:23 2000
+++ mysrc/contrib/ipfilter/iplang/iplang_y.y	Wed Jul 19 16:30:20 2000
@@ -48,7 +48,7 @@
 #include "ipf.h"
 #include "iplang.h"
 
-#ifndef __NetBSD__
+#if !defined(__NetBSD__) && !defined(__FreeBSD__)
 extern	struct ether_addr *ether_aton __P((char *));
 #endif
 
--- src/usr.sbin/wlconfig/wlconfig.c	Wed Jul 19 15:43:30 2000
+++ mysrc/usr.sbin/wlconfig/wlconfig.c	Wed Jul 19 16:30:49 2000
@@ -69,7 +69,6 @@
 #include <net/if.h>
 #include <netinet/in.h>
 #include <netinet/if_ether.h>
-extern struct ether_addr *ether_aton(char *a);
 
 #include <err.h>
 #include <stdio.h>
Comment 3 Archie Cobbs freebsd_committer freebsd_triage 2000-07-19 17:33:29 UTC
State Changed
From-To: open->closed

Applied the second set of patches from Peter Pentchev in the PR.