- Timestamp:
- Nov 1, 2010, 12:13:47 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r295 r298 1754 1754 dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h 1755 1755 t-test1.o: $(srcsrc)/t-test1.c Makefile config.h $(srcinc)/malloc.h 1756 sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error_min.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h 1756 sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error_min.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h 1757 1757 sh_log_parse_syslog.o: $(srcsrc)/sh_log_parse_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 1758 1758 sh_log_parse_pacct.o: $(srcsrc)/sh_log_parse_pacct.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h -
trunk/src/sh_port2proc.c
r295 r298 352 352 unsigned int n, i, port, niface, inode, istatus; 353 353 char line[512]; 354 char ip_port[128]; 354 355 char iface[SH_IP_BUF]; 355 356 … … 363 364 #endif 364 365 365 if ( 5== sscanf(line,366 "%u: % s:%X%*X:%*X %X %*X:%*X %*X:%*X %*X %*d %*d %u %*s",367 &n, i face, &port, &istatus, &inode))366 if (4 == sscanf(line, 367 "%u: %127s %*X:%*X %X %*X:%*X %*X:%*X %*X %*d %*d %u %*s", 368 &n, ip_port, &istatus, &inode)) 368 369 { 369 370 struct sockaddr_in addr4; … … 371 372 struct sh_sockaddr ss; 372 373 374 char * p; 375 376 ip_port[127] = '\0'; 377 378 p = strchr(ip_port, ':'); 379 380 if (p) 381 { 382 *p = '\0'; ++p; 383 port = (unsigned int) strtoul(p, NULL, 16); 384 sl_strlcpy(iface, ip_port, sizeof(iface)); 385 } 386 else 387 { 388 continue; 389 } 390 373 391 niface = 0; 374 392
Note:
See TracChangeset
for help on using the changeset viewer.