Bug 120304 - [netgraph] [patch] netgraph source assumes 32-bit timeval on AMD64
Summary: [netgraph] [patch] netgraph source assumes 32-bit timeval on AMD64
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 6.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Eugene Grosbein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-05 21:20 UTC by Mike Neuman
Modified: 2019-07-26 19:55 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (698 bytes, patch)
2008-02-05 21:20 UTC, Mike Neuman
no flags Details | Diff
ng_source.c.diff (586 bytes, patch)
2013-05-13 09:01 UTC, Dmitry
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Neuman 2008-02-05 21:20:02 UTC
The ng_source module assumes that struct timevals contain 32-bit fields,
which is not the case on amd64 machines.

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:
How-To-Repeat: kldload ng_ether
ngctl mkpeer em0: source orphans output
nghook em0:orphans input <raw-packet.cap
ngctl msg em0:orphans start 16
ngctl msg em0:orphans getstats

Note the stats show the various timevals precessing based upon word length.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2008-02-05 22:29:47 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Over to maintainer(s).
Comment 2 Eugene Grosbein 2012-08-07 13:38:08 UTC
Hi!

This is still the problem for 9.1-PRERELEASE: ng_source is unusable for 64bit systems.
The patch really helps and fixes the problem for 64bit (and breaks for 32bit :-)

Perhaps, it may be improved with some #ifdef's

Eugene Grosbein
Comment 3 Dmitry 2013-05-13 09:01:20 UTC
This is a more accuracy patch
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:01 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 5 Eugene Grosbein freebsd_committer freebsd_triage 2019-07-26 19:55:24 UTC
Fixed in all supported branches: 12.0-STABLE (r343021) and 11.2-STABLE (r343022).