[tkined] netdb services handling for 3com-tsmux (106/tcp)

From: Jun Kuriyama (kuriyama@imgsrc.co.jp)
Date: Fri Aug 11 2000 - 03:08:57 MET DST


TnmSetIPPort() in tnm/generic/tnmUtil.c assumes service names begin
with non-numeric character. But 3com-tsmux (106/tcp, 106/udp) which
is assigned by IANA begins with '3'. TnmSetIPPort() will treat
service name "3com-tsmux" as numeric "3".

This patch will fix that behavior.

Index: tnmUtil.c
===================================================================
RCS file: /anoncvs/scotty/tnm/generic/tnmUtil.c,v
retrieving revision 1.13
diff -u -r1.13 tnmUtil.c
--- tnmUtil.c 1999/10/06 09:36:01 1.13
+++ tnmUtil.c 2000/08/11 01:03:31
@@ -1034,6 +1034,9 @@
     char *port;
     struct sockaddr_in* addr;
 {
+ char *p = port;
+ int isnum = 1;
+
     if (strcmp(protocol, "udp") != 0 && strcmp(protocol, "tcp") != 0) {
         if (interp) {
             Tcl_ResetResult(interp);
@@ -1042,8 +1045,12 @@
         }
         return TCL_ERROR;
     }
+
+ while (*p) {
+ if (!isdigit(*p++)) isnum = 0;
+ }
 
- if (isdigit(*port)) {
+ if (isnum) {
         int number = atoi(port);
         if (number >= 0) {
             addr->sin_port = htons((unsigned short) number);

-- 
Jun Kuriyama <kuriyama@imgsrc.co.jp> // IMG SRC, Inc.
             <kuriyama@FreeBSD.org> // FreeBSD Project
--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.



This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:51 MET