From 032caee6ac8c8864f5d3ce705ad238ae7383177c Mon Sep 17 00:00:00 2001 From: david Date: Sun, 25 Sep 2011 19:14:33 +0000 Subject: [PATCH] o Made the interface gathering loop work on Linux when an interface index is more than two digits in /proc/sys/if_inet6. Joe McEachern tracked down the problem and provided the fix. --- CHANGELOG | 4 ++++ libdnet-stripped/NMAP_MODIFICATIONS | 14 ++++++++++++++ libdnet-stripped/src/intf.c | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e7d985fe2..c08aba607 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Nmap Changelog ($Id$); -*-text-*- +o Made the interface gathering loop work on Linux when an interface + index is more than two digits in /proc/sys/if_inet6. Joe McEachern + tracked down the problem and provided the fix. + o [NSE] Added ssl-google-cert-catalog.nse which queries the Google SSL certificates catalog for each discovered certificate. [Vasiliy Kulikov] diff --git a/libdnet-stripped/NMAP_MODIFICATIONS b/libdnet-stripped/NMAP_MODIFICATIONS index fd9d888b2..719c3793f 100644 --- a/libdnet-stripped/NMAP_MODIFICATIONS +++ b/libdnet-stripped/NMAP_MODIFICATIONS @@ -561,6 +561,20 @@ Index: include/dnet/sctp.h /* empty */ } __attribute__((__packed__)); +o Allowed reading interface indexes that exceed 255 on Linux. + +--- libdnet-stripped/src/intf.c ++++ libdnet-stripped/src/intf.c +@@ -560,7 +560,7 @@ _intf_get_aliases(intf_t *intf, struct intf_entry *entry) + if ((f = fopen(PROC_INET6_FILE, "r")) != NULL) { + while (ap < lap && + fgets(buf, sizeof(buf), f) != NULL) { +- sscanf(buf, "%04s%04s%04s%04s%04s%04s%04s%04s %02x %02x %02x %02x %32s\n", ++ sscanf(buf, "%04s%04s%04s%04s%04s%04s%04s%04s %x %02x %02x %02x %32s\n", + s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], + &idx, &bits, &scope, &flags, name); + if (strcmp(name, entry->intf_name) == 0) { + ===CHANGES ALREADY MERGED TO UPSTREAM LIBDNET GO BELOW THIS LINE=== o Fixed the ip6_pack_hdr macro with respect to traffic class and flow diff --git a/libdnet-stripped/src/intf.c b/libdnet-stripped/src/intf.c index f76521043..236e1bcb4 100644 --- a/libdnet-stripped/src/intf.c +++ b/libdnet-stripped/src/intf.c @@ -560,7 +560,7 @@ _intf_get_aliases(intf_t *intf, struct intf_entry *entry) if ((f = fopen(PROC_INET6_FILE, "r")) != NULL) { while (ap < lap && fgets(buf, sizeof(buf), f) != NULL) { - sscanf(buf, "%04s%04s%04s%04s%04s%04s%04s%04s %02x %02x %02x %02x %32s\n", + sscanf(buf, "%04s%04s%04s%04s%04s%04s%04s%04s %x %02x %02x %02x %32s\n", s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], &idx, &bits, &scope, &flags, name); if (strcmp(name, entry->intf_name) == 0) {