From nobody@FreeBSD.org Tue Feb 5 21:19:00 2008 Return-Path: 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 Subject: Netgraph Source assumes 32-bit timeval on AMD64 X-Send-Pr-Version: www-3.1 X-GNATS-Notify: >Number: 120304 >Category: kern >Synopsis: [netgraph] [patch] netgraph source assumes 32-bit timeval on AMD64 >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-net >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: Tue Feb 05 22:29:53 UTC 2008 >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: Responsible-Changed-From-To: freebsd-bugs->freebsd-net Responsible-Changed-By: linimon Responsible-Changed-When: Tue Feb 5 22:29:47 UTC 2008 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=120304 >Unformatted: