Subject: port-i386/1050: CAP support for NetBSD-1.0 i386
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: None <paul@frcs.alt.za>
List: netbsd-bugs
Date: 05/15/1995 11:35:05
>Number:         1050
>Category:       port-i386
>Synopsis:       Adds SIOCGIFADDR to if_ed driver, multicast to BPF
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon May 15 11:35:03 1995
>Originator:     Paul Nash
>Organization:
Free Range Computers, Canberra, AUSTRALIA
>Release:        1.0
>Environment:
NetBSD 1.0 on generic i386 hardware
System: NetBSD tantrum.frcs.alt.za 1.0 NetBSD 1.0 (TANTRUM) #7: Tue May 2 18:46:12 EST 1995 paul@tantrum.frcs.alt.za:/usr/src/sys/arch/i386/compile/TANTRUM i386

>Description:
CAP (Columbia Appletalk Package) requires SIOCGIFADDR to obtain the
ethernet address of any interface it uses.  It also needs to set 
multicast operation of the interface via the BPF device.
>How-To-Repeat:
>Fix:

2) Minor hacks to the NetBSD kernel:
   * tweak "if_ed.c" to recognise SIOCGIFADDR -- this will need to
     be put into other ethernet drivers
   * tweak to "bpf.c" so that the Bezerkely Packet Filter passes
     multicast ioctl()s on to the driver.  I've not looked at the
     other ether drivers, but if_ed (WD et al) supports multicast,
     hence Appletalk Phase 2.
   These may well not be needed for NetBSD-current, but I've not got
   the time to upgrade (yet), and many others will no doubt want to 
   stick with -1.0.

*** sys/net/bpf.orig	Tue May  2 19:32:37 1995
--- sys/net/bpf.c	Tue May  2 19:36:41 1995
***************
*** 617,622 ****
--- 617,624 ----
  		}
  
  	case SIOCGIFADDR:
+ 	case SIOCADDMULTI:
+ 	case SIOCDELMULTI:
  		{
  			struct ifnet *ifp;
  
*** sys/arch/i386/isa/if_ed.orig	Tue May  2 19:33:53 1995
--- sys/arch/i386/isa/if_ed.c		Wed Apr  5 10:59:08 1995
***************
*** 1801,1806 ****
--- 1801,1814 ----
  
  	switch (command) {
  
+ #if ! defined (SIOCGIFADDR_BROKEN)
+ 	case SIOCGIFADDR:
+ 		{
+ 	      		struct sockaddr *sa = &ifr->ifr_addr;
+ 	      		bcopy(sc->sc_arpcom.ac_enaddr, sa->sa_data, 6);
+ 			break;
+ 		}
+ #endif /* SIOCGIFADDR_WORKS */
  	case SIOCSIFADDR:
  		ifp->if_flags |= IFF_UP;
  

--
   Paul Nash <paul@frcs.alt.za>       turbo-nerd & all-round nice guy
       14/114 Blamey Cres, Campbell, Canberra ACT 2601, AUSTRALIA
        finger <pauln@mickey.iafrica.com> for PGP 2.6 public key
>Audit-Trail:
>Unformatted: