Nmap Development mailing list archives
libnetutil/netutil.cc issues
From: Gisle Vanem <gvanem () broadpark no>
Date: Wed, 07 Aug 2013 20:06:26 +0200
This file has several problems on Win32.
1st, line 2653: Snprintf(protoinfo, sizeof(protoinfo), "SCTP [%s:%d > %s:%d vtag=%lu csum=0x%08lx] IP [%s]", srchost, ntohs(sctp->sh_sport), dsthost, ntohs(sctp->sh_dport), ntohl(sctp->sh_sum), ntohl(sctp->sh_vtag) ipinfo); Here the values for 'vtag' and 'csum' are swapped. 2nd, it uses format "%ul" several places. Is that the same as "%lu" on all platforms? Is so, why not use that. My MingW-gcc complains on those lines. And finally, ntohl() returns u_long or in_addr_t. So shouldn't we use "%lu" and not "%u" for "timestamp" and "csum"? --gv _______________________________________________ Sent through the dev mailing list http://nmap.org/mailman/listinfo/dev Archived at http://seclists.org/nmap-dev/
Current thread:
- libnetutil/netutil.cc issues Gisle Vanem (Aug 07)
- Re: libnetutil/netutil.cc issues David Fifield (Aug 15)