Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Sep 2007 04:24:25 GMT
From:      Tarragon Allen <tallen@realestate.com.au>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/116069: snmp is missing PhysAddress
Message-ID:  <200709040424.l844OPK6040103@www.freebsd.org>
Resent-Message-ID: <200709040430.l844U7mP043978@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         116069
>Category:       misc
>Synopsis:       snmp is missing PhysAddress
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 04 04:30:07 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Tarragon Allen
>Release:        6.2-RELEASE-p1
>Organization:
realestate.com.au
>Environment:
FreeBSD trea26.telstra.realestate.com.au 6.2-RELEASE-p1 FreeBSD 6.2-RELEASE-p1 #0: Fri Feb 23 16:13:11 EST 2007 joelc@rea30.realestate.com.au:/usr/src/sys/amd64/compile/SMP  amd64
>Description:
/usr/ports/net-mgmt/net-snmp 5.3.1_3 (and earlier) aren't returning the PhysAddress field when snmpwalked. It appears that an earlier patch was applied to fix this very problem with FreeBSD 3.x, 4.x and 5.x, but wasn't applied for 6.x.

http://www.freebsd.org/cgi/cvsweb.cgi/ports/net-mgmt/net-snmp/files/patch-interfaces.c?r1=1.4#rev1.4

I extended the check so that it covers FreeBSD 6.x as well and it now works as expected.
>How-To-Repeat:
Install net-snmp on a FreeBSD 6.2 system, and check the Physical Addresses with "snmpwalk -cpublic -v2c <hostname> Phys".
>Fix:

I made the following change to files/patch-interfaces.c:

@@ -55,7 +55,7 @@
 +            physaddrbuf = 0;
 +        }
 +        ifm = (struct if_msghdr *) rtm;
-+#if defined(freebsd3) || defined(freebsd4) || defined(freebsd5)
++#if defined(freebsd3) || defined(freebsd4) || defined(freebsd5) || defined(freebsd6)
 +        if (physaddrs != 0)
 +            physaddrs[naddrs] = (void *) (ifm + 1);
 +        naddrs++;
@@ -64,7 +64,7 @@
 +        cp += ifm->ifm_msglen;
 +        rtm = (struct rt_msghdr *) cp;
 +        while (ilen > 0 && rtm->rtm_type == RTM_NEWADDR) {
-+#if defined(freebsd3) || defined(freebsd4) || defined(freebsd5)
++#if defined(freebsd3) || defined(freebsd4) || defined(freebsd5) || defined(freebsd6)
 +            ilen -= rtm->rtm_msglen;
 +            cp += rtm->rtm_msglen;
 +#else


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709040424.l844OPK6040103>