Summary: | bsnmpd returns wrong data in ipAddrTable | ||
---|---|---|---|
Product: | Base System | Reporter: | wolfgang |
Component: | bin | Assignee: | Bjoern A. Zeeb <bz> |
Status: | Closed FIXED | ||
Severity: | Affects Some People | CC: | bz, cb, eugen, smarouchoc, wolfgang |
Priority: | --- | Keywords: | regression |
Version: | 10.1-STABLE | ||
Hardware: | Any | ||
OS: | Any |
Description
wolfgang
2014-11-27 10:23:20 UTC
I have tested this on i386, amd64 and mips platforms so far, doesn't work on either one using 10.1-STABLE. All amd64 machines have the output as in the PR, i386 and mips give ipAdEntNetMask[0.0.0.0] = 0.0.0.0 instead. My only test machine with 8.4-STABLE is an i386, there it works ok. The regression was introduced in r228571, which was copied to the 10-STABLE branch when it was created, but not merged to 9. http://svnweb.freebsd.org/base/head/contrib/bsnmp/snmp_mibII/mibII.c?r1=228623&r2=228622&pathrev=228623 That change can't possibly work, because struct ifa_msghdr is just the header, and does not include the payload of the message, which the IP addresses are extracted from. Reverting it fixes the problem for me on amd64 and i386. Presumably it may also cause bsnmpd to fault on architectures with strict alignment requirements. Meant to type r228623 -- the link is correct however. Can you try this patch please? https://people.freebsd.org/~bz/20160123-01-bsnmp-mibII.diff I've tested the patch on 10.2-STABLE with i386 and amd64, both work fine. Will need some time before I can test on mpis64. A commit references this bug: Author: bz Date: Wed Feb 3 11:03:44 UTC 2016 New revision: 295202 URL: https://svnweb.freebsd.org/changeset/base/295202 Log: Try to fix a bug introduced in r228623. We started to copy the ifa_msghdr as otherwise platforms with strict alignment would break. It's unclear to me if there's also a problem with access to the address list following the structure. However we never copied the address list after the structure and thus are pointing at random memory. For now just use a pointer to the original memory for accessing the address list making it at least work on platforms with weak memory access. PR: 195445 Reported by: wolfgang lyxys.ka.sub.org Tested by: wolfgang lyxys.ka.sub.org (x86) MFC after: 3 days Changes: head/contrib/bsnmp/snmp_mibII/mibII.c A commit references this bug: Author: bz Date: Sun Feb 7 22:53:04 UTC 2016 New revision: 295386 URL: https://svnweb.freebsd.org/changeset/base/295386 Log: MFC r295202: Try to fix a bug introduced in r228623 (head). We started to copy the ifa_msghdr as otherwise platforms with strict alignment would break. It is unclear to me if there's also a problem with access to the address list following the structure. However we never copied the address list after the structure and thus are pointing at random memory. For now just use a pointer to the original memory for accessing the address list making it at least work on platforms with weak memory access. PR: 195445 Reported by: wolfgang lyxys.ka.sub.org Tested by: wolfgang lyxys.ka.sub.org (x86) Approved by: re (marius) Changes: _U stable/10/ stable/10/contrib/bsnmp/snmp_mibII/mibII.c Fixed and MFC'd over a year ago. *** Bug 203264 has been marked as a duplicate of this bug. *** |