From owner-freebsd-net Sat Nov 3 9:15:20 2001 Delivered-To: freebsd-net@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id A473E37B417 for ; Sat, 3 Nov 2001 09:15:18 -0800 (PST) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.3/8.11.1) id fA3HBhT56102; Sat, 3 Nov 2001 09:11:43 -0800 (PST) (envelope-from rizzo) Date: Sat, 3 Nov 2001 09:11:43 -0800 From: Luigi Rizzo To: net@freebsd.org, mjacob@feral.com Subject: softc, ifnet and arpcom overlay Message-ID: <20011103091143.B47299@iguana.aciri.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.23i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, i remember early in october this topic came out, but while i can easily find out where the arpcom/ifnet overlay is used, i am not totally certain about the softc/ifnet overlay. For first, there is a reference from ifnet to the corresponding softc, so in principle the overlay is totally unnecessary. Secondly, the only two places where I could find this assumption being actually used seem to be easily fixable: net/if_iso88025subr.c - line 139 @iso88025_ioctl() bcopy(((struct arpcom *)ifp->if_softc)->ac_enaddr, (caddr_t) sa->sa_data, ISO88025_ADDR_LEN); here, the "->if_softc" should be just omitted because ifp can be already cast to a (struct arpcom *) net/if_vlan.c - lnie 528 @vlan_ioctl() bcopy(((struct arpcom *)ifp->if_softc)->ac_enaddr, (caddr_t) sa->sa_data, ETHER_ADDR_LEN); same as above (these two sections seem to be copied one from the other) Is there any other place to look at ? cheers luigi ----------------------------------+----------------------------------------- Luigi RIZZO, luigi@iet.unipi.it . ACIRI/ICSI (on leave from Univ. di Pisa) http://www.iet.unipi.it/~luigi/ . 1947 Center St, Berkeley CA 94704 Phone: (510) 666 2927 ----------------------------------+----------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message