diff options
Diffstat (limited to 'net-mgmt/sdig')
-rw-r--r-- | net-mgmt/sdig/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/sdig/files/patch-sdig.c | 42 |
2 files changed, 43 insertions, 0 deletions
diff --git a/net-mgmt/sdig/Makefile b/net-mgmt/sdig/Makefile index f3a05678c7e0..6791546cdfdd 100644 --- a/net-mgmt/sdig/Makefile +++ b/net-mgmt/sdig/Makefile @@ -7,6 +7,7 @@ PORTNAME= sdig PORTVERSION= 0.40 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= http://www.exploits.org/sdig/ diff --git a/net-mgmt/sdig/files/patch-sdig.c b/net-mgmt/sdig/files/patch-sdig.c new file mode 100644 index 000000000000..3559519dd440 --- /dev/null +++ b/net-mgmt/sdig/files/patch-sdig.c @@ -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); + } + } |