From owner-freebsd-hackers Sat Dec 21 23: 1:15 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D95E037B401 for ; Sat, 21 Dec 2002 23:01:10 -0800 (PST) Received: from angelica.unixdaemons.com (angelica.unixdaemons.com [209.148.64.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C04B43EDC for ; Sat, 21 Dec 2002 23:01:10 -0800 (PST) (envelope-from hiten@angelica.unixdaemons.com) Received: from angelica.unixdaemons.com (hiten@localhost.unixdaemons.com [127.0.0.1]) by angelica.unixdaemons.com (8.12.6/8.12.1) with ESMTP id gBM719sB082422; Sun, 22 Dec 2002 02:01:09 -0500 (EST) Received: (from hiten@localhost) by angelica.unixdaemons.com (8.12.6/8.12.1/Submit) id gBM718wK082421; Sun, 22 Dec 2002 02:01:08 -0500 (EST) (envelope-from hiten) Date: Sun, 22 Dec 2002 02:01:08 -0500 From: Hiten Pandya To: Attila Nagy Cc: hackers@FreeBSD.org Subject: Re: FEC doesn't build on 5.0 Message-ID: <20021222070108.GA80520@unixdaemons.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline User-Agent: Mutt/1.4i X-Operating-System: FreeBSD i386 X-Public-Key: http://www.pittgoth.com/~hiten/pubkey.asc X-URL: http://www.unixdaemons.com/~hiten X-PGP: http://pgp.mit.edu:11371/pks/lookup?search=Hiten+Pandya&op=index Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > Hello > > Heither of the original (http://people.freebsd.org/~wpaul/FEC/) not > the in tree FEC implementations build. Hi there. The reason it doesn't build is because, the ng_fec was somehow left out when Sam Leffler was making changes to the ether_if{de,at}tach() and bpf interfaces. Anyway, a complete fix, which should be committed is attached with this mail. Also, I believe you have used the implementation from wpaul's website. Could you try using the `in-tree' version of the FEC Netgraph driver, because many of the ifnet_addrs* related problems have been resolved in it by julian@. Cheers. -- Hiten Pandya (hiten@unixdaemons.com, hiten@uk.FreeBSD.org) http://www.unixdaemons.com/~hiten/ --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="netgraph+ng_fec-various.patch" Index: netgraph/ng_fec.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netgraph/ng_fec.c,v retrieving revision 1.2 diff -u -r1.2 ng_fec.c --- netgraph/ng_fec.c 1 Nov 2002 23:09:15 -0000 1.2 +++ netgraph/ng_fec.c 21 Dec 2002 22:34:27 -0000 @@ -188,6 +188,10 @@ static void ng_fec_print_ioctl(struct ifnet *ifp, int cmd, caddr_t data); #endif +/* ng_ether_input_p - see sys/netgraph/ng_ether.c */ +extern void (*ng_ether_input_p)(struct ifnet *ifp, struct mbuf **mp, + struct ether_header *eh); + /* Netgraph methods */ static ng_constructor_t ng_fec_constructor; static ng_rcvmsg_t ng_fec_rcvmsg; @@ -760,7 +764,7 @@ mh.mh_next = m; mh.mh_data = (char *)eh; mh.mh_len = ETHER_HDR_LEN; - bpf_mtap(bifp, (struct mbuf *)&mh); + BPF_MTAP(bifp, (struct mbuf *)&mh); } return; @@ -977,8 +981,7 @@ if (m0 == NULL) return; - if (ifp->if_bpf) - bpf_mtap(ifp, m0); + BPF_MTAP(ifp, m0); /* Queue up packet on the proper port. */ error = ng_fec_choose_port(b, m0, &oifp); @@ -1097,7 +1100,7 @@ ng_ether_input_p = ng_fec_input; /* Attach the interface */ - ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + ether_ifattach(ifp, priv->arpcom.ac_enaddr); callout_handle_init(&priv->fec_ch); TAILQ_INIT(&b->ng_fec_ports); @@ -1190,7 +1193,7 @@ if (ng_ether_input_p != NULL) ng_ether_input_p = NULL; - ether_ifdetach(&priv->arpcom.ac_if, ETHER_BPF_SUPPORTED); + ether_ifdetach(&priv->arpcom.ac_if); ifmedia_removeall(&priv->ifmedia); ng_fec_free_unit(priv->unit); FREE(priv, M_NETGRAPH); Index: modules/netgraph/fec/Makefile =================================================================== RCS file: /home/hiten/ncvs/src/sys/modules/netgraph/fec/Makefile,v retrieving revision 1.1 diff -u -r1.1 Makefile --- modules/netgraph/fec/Makefile 29 Oct 2002 19:12:44 -0000 1.1 +++ modules/netgraph/fec/Makefile 21 Dec 2002 22:57:09 -0000 @@ -4,7 +4,7 @@ SRCS= ng_fec.c opt_inet.h opt_inet6.h #MAN4= ng_fec.4 NOMAN= yes -KMODDEPS= netgraph +MODULE_DEPEND= netgraph CFLAGS += -DINET -DINET6 --FCuugMFkClbJLl1L-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message