Some switches do not contain useful data in the MIB::ifDescr field. This patch will allow sdig to report MIB::ifName or MIB::ifAlias in addition to MIB::ifDescr.
Is this patch maybe reverted or something? There's no such thing as files/patch-sdig.c in the repository. Maybe a screw-up from the time this port was added? Please start out with a fresh checkout of the port from the repository. Cheers, Volker
State Changed From-To: open->feedback Problems patching.
Responsible Changed From-To: freebsd-ports-bugs->vs Problems patching.
On Sun, May 23, 2004 at 02:04:38PM +0200, Volker Stolz wrote: > Is this patch maybe reverted or something? There's no such thing as > files/patch-sdig.c in the repository. Maybe a screw-up from the time > this port was added? Please start out with a fresh checkout of the port > from the repository. > > Cheers, > Volker Opps! My bad. It is reverted. Here's the corrected patch. Should have tested it first. diff -urN sdig/files/patch-sdig.c sdig.new/files/patch-sdig.c --- sdig/files/patch-sdig.c Wed Dec 31 16:00:00 1969 +++ sdig.new/files/patch-sdig.c Sun May 23 14:16:09 2004 @@ -0,0 +1,42 @@ +--- sdig.c.orig Mon Mar 24 13:08:00 2003 ++++ sdig.c Wed May 19 13:17:43 2004 +@@ -426,7 +426,7 @@ + + static void do_ifdescr(stype *sw, long port) + { +- char query[256], *ifdescr; ++ char query[256], *ifdescr, *ifname; + long ifnum; + + /* first get the switch's ifnum for the port */ +@@ -437,13 +437,28 @@ + if (ifnum == -1) + return; + +- snprintf(query, sizeof(query), "interfaces.ifTable.ifEntry.ifDescr.%ld", ++ snprintf(query, sizeof(query), "IF-MIB::ifName.%ld", ++ ifnum); ++ ++ ifname = snmpget_str(sw->ip, sw->pw, query); ++ ++ if (!ifname) { ++ snprintf(query, sizeof(query), "IF-MIB::ifAlias.%ld", ifnum); ++ snmpget_str(sw->ip, sw->pw, query); ++ } ++ ++ snprintf(query, sizeof(query), "IF-MIB::ifDescr.%ld", + ifnum); + + ifdescr = snmpget_str(sw->ip, sw->pw, query); + ++ if (ifname) { ++ printf(" (%s)", ifname); ++ free(ifname); ++ } ++ + if (ifdescr) { +- printf(" (%s)", ifdescr); ++ printf(" [%s]", ifdescr); + free(ifdescr); + } + } -- Russell A. Jackson (rjackson@cserv62.csub.edu)
State Changed From-To: feedback->closed Committed, thanks!