From owner-freebsd-net@FreeBSD.ORG Wed Aug 30 14:22:35 2006 Return-Path: X-Original-To: freebsd-net@FreeBSD.org Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9EAE116A4DD for ; Wed, 30 Aug 2006 14:22:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC39143D49 for ; Wed, 30 Aug 2006 14:22:34 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.4/8.13.3) with ESMTP id k7UEMWrI028337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 30 Aug 2006 18:22:32 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.4/8.13.1/Submit) id k7UEMVGJ028336; Wed, 30 Aug 2006 18:22:31 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 30 Aug 2006 18:22:31 +0400 From: Gleb Smirnoff To: Rajkumar S Message-ID: <20060830142231.GX76666@FreeBSD.org> Mail-Followup-To: Gleb Smirnoff , Rajkumar S , freebsd-net@freebsd.org References: <64de5c8b0608300531y7ab06ea5ibde5c96aaaa6374e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <64de5c8b0608300531y7ab06ea5ibde5c96aaaa6374e@mail.gmail.com> User-Agent: Mutt/1.5.6i Cc: freebsd-net@FreeBSD.org Subject: Re: sending NGM_BPF_SET_PROGRAM message to a bpf node from a program X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Aug 2006 14:22:35 -0000 On Wed, Aug 30, 2006 at 06:01:10PM +0530, Rajkumar S wrote: R> and messaging the bpf: using the following code fragment. R> R> if (NgSendMsg(cfd, "bpf:", NGM_GENERIC_COOKIE, R> NGM_BPF_SET_PROGRAM, bpf_hookprog, (sizeof R> (struct ng_bpf_hookprog) + fp.bf_len * sizeof (struct bpf_insn))) < 0) R> { R> perror ("Setup bpf program"); R> return (-1); R> } The cookie shouldn't be NGM_GENERIC_COOKIE, but should be NGM_BPF_COOKIE. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE