Date: Fri, 2 Aug 1996 04:49:56 +1000 (EST) From: michael butler <imb@scgt.oz.au> To: gpalmer@freebsd.org Cc: ports@freebsd.org Subject: small patch for UCD SNMP Message-ID: <199608011849.EAA19945@asstdc.scgt.oz.au>
next in thread | raw e-mail | index | archive | help
In case anyone's actually noticed .. there's a host <> network byte order problem in snmpnetstat when displaying port numbers which also appeared in the CMU code. I've verified that the following patch is correct using my Cisco as a reference point .. Note that the line-numbers are probably wrong but my (rather) hacked version of .../apps/snmpnetstat/inet.c generates this diff .. *** inet.c~ Wed Apr 24 22:42:03 1996 --- inet.c Wed Apr 24 23:55:36 1996 *************** *** 457,463 **** sprintf(line, "%.*s.", 16, inetname(*in)); cp = index(line, '\0'); if (!nflag && port) ! sp = getservbyport((int)port, proto); if (sp || port == 0) sprintf(cp, "%.8s", sp ? sp->s_name : "*"); else --- 457,463 ---- sprintf(line, "%.*s.", 16, inetname(*in)); cp = index(line, '\0'); if (!nflag && port) ! sp = getservbyport((int)ntohs(port), proto); if (sp || port == 0) sprintf(cp, "%.8s", sp ? sp->s_name : "*"); else Sorry, I'm not on the ports list so, if this has already been addressed, I apologize, michael
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608011849.EAA19945>