From owner-freebsd-bugs@FreeBSD.ORG Tue Feb 5 21:20:03 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58E1816A41A for ; Tue, 5 Feb 2008 21:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 396F613C46A for ; Tue, 5 Feb 2008 21:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m15LK3Mr087474 for ; Tue, 5 Feb 2008 21:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m15LK3mb087467; Tue, 5 Feb 2008 21:20:03 GMT (envelope-from gnats) Resent-Date: Tue, 5 Feb 2008 21:20:03 GMT Resent-Message-Id: <200802052120.m15LK3mb087467@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mike Neuman Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A17B16A41B for ; Tue, 5 Feb 2008 21:19:00 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 2975913C45B for ; Tue, 5 Feb 2008 21:19:00 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m15LGwMR016592 for ; Tue, 5 Feb 2008 21:16:58 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m15LGwZB016590; Tue, 5 Feb 2008 21:16:58 GMT (envelope-from nobody) Message-Id: <200802052116.m15LGwZB016590@www.freebsd.org> Date: Tue, 5 Feb 2008 21:16:58 GMT From: Mike Neuman To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/120304: Netgraph Source assumes 32-bit timeval on AMD64 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2008 21:20:03 -0000 >Number: 120304 >Category: kern >Synopsis: Netgraph Source assumes 32-bit timeval on AMD64 >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 05 21:20:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Mike Neuman >Release: 6.3-RELEASE >Organization: En Garde Systems >Environment: FreeBSD xeonpm.engarde.com 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Tue Feb 5 10:54:16 PST 2008 mcn@xeonpm.engarde.com:/usr/src/sys/amd64/compile/PRIVATE amd64 >Description: The ng_source module assumes that struct timevals contain 32-bit fields, which is not the case on amd64 machines. >How-To-Repeat: kldload ng_ether ngctl mkpeer em0: source orphans output nghook em0:orphans input Fix: The fix for amd64 is simple, however the patch is not suitable because it should handle both 32-bit and 64-bit timeval lengths. I did not readily find the proper way to do this. Patch attached with submission follows: *** sys/netgraph/ng_source.c.orig Tue Feb 5 13:00:47 2008 --- sys/netgraph/ng_source.c Tue Feb 5 12:17:36 2008 *************** *** 113,120 **** /* Parse type for timeval */ static const struct ng_parse_struct_field ng_source_timeval_type_fields[] = { ! { "tv_sec", &ng_parse_int32_type }, ! { "tv_usec", &ng_parse_int32_type }, { NULL } }; const struct ng_parse_type ng_source_timeval_type = { --- 113,120 ---- /* Parse type for timeval */ static const struct ng_parse_struct_field ng_source_timeval_type_fields[] = { ! { "tv_sec", &ng_parse_int64_type }, ! { "tv_usec", &ng_parse_int64_type }, { NULL } }; const struct ng_parse_type ng_source_timeval_type = { >Release-Note: >Audit-Trail: >Unformatted: