Index: scripts/firewalk.nse =================================================================== --- scripts/firewalk.nse (revision 27813) +++ scripts/firewalk.nse (working copy) @@ -189,10 +189,10 @@ if port and scanner.ports.tcp[port] then - stdnse.print_debug("Marking port %d/tcp v4 as forwarded (reply from %s)", ip2.tcp_dport, toip(ip.ip_bin_src)) + stdnse.print_debug("Marking port %d/tcp v4 as forwarded (reply from %s)", ip2.tcp_dport, ip.ip_src) -- mark the gateway as forwarding the packet - scanner.ports.tcp[port].final_ttl = gateway_ttl(scanner.target.traceroute, toip(ip.ip_bin_src)) + scanner.ports.tcp[port].final_ttl = gateway_ttl(scanner.target.traceroute, ip.ip_src) scanner.ports.tcp[port].scanned = true -- remove the related probe @@ -256,7 +256,7 @@ stdnse.print_debug("Marking port %d/udp v4 as forwarded", ip2.udp_dport) -- mark the gateway as forwarding the packet - scanner.ports.udp[port].final_ttl = gateway_ttl(scanner.target.traceroute, toip(ip.ip_bin_src)) + scanner.ports.udp[port].final_ttl = gateway_ttl(scanner.target.traceroute, ip.ip_src) scanner.ports.udp[port].scanned = true for i, probe in ipairs(scanner.active_probes) do @@ -316,10 +316,10 @@ if port and scanner.ports.tcp[port] then - stdnse.print_debug("Marking port %d/tcp v6 as forwarded (reply from %s)", ip2.tcp_dport, toip(ip.ip6_src)) + stdnse.print_debug("Marking port %d/tcp v6 as forwarded (reply from %s)", ip2.tcp_dport, ip.ip_src) -- mark the gateway as forwarding the packet - scanner.ports.tcp[port].final_ttl = gateway_ttl(scanner.target.traceroute, toip(ip.ip6_src)) + scanner.ports.tcp[port].final_ttl = gateway_ttl(scanner.target.traceroute, ip.ip_src) scanner.ports.tcp[port].scanned = true -- remove the related probe @@ -378,10 +378,10 @@ if port and scanner.ports.udp[port] then - stdnse.print_debug("Marking port %d/udp v6 as forwarded (reply from %s)", ip2.udp_dport, toip(ip2.ip6_src)) + stdnse.print_debug("Marking port %d/udp v6 as forwarded (reply from %s)", ip2.udp_dport, ip2.ip_src) -- mark the gateway as forwarding the packet - scanner.ports.udp[port].final_ttl = gateway_ttl(scanner.target.traceroute, toip(ip.ip6_src)) + scanner.ports.udp[port].final_ttl = gateway_ttl(scanner.target.traceroute, ip.ip_src) scanner.ports.udp[port].scanned = true for i, probe in ipairs(scanner.active_probes) do @@ -440,7 +440,7 @@ --- IPv4 initialization function. Open injection and reception sockets. -- @param scanner the scanner handle init = function(scanner) - local saddr = toip(scanner.target.bin_ip_src) + local saddr = packet.toip(scanner.target.bin_ip_src) scanner.sock = nmap.new_dnet() scanner.pcap = nmap.new_socket() @@ -506,7 +506,7 @@ --- IPv6 initialization function. Open injection and reception sockets. -- @param scanner the scanner handle init = function(scanner) - local saddr = toip(scanner.target.bin_ip_src) + local saddr = packet.toipv6(scanner.target.bin_ip_src) scanner.sock = nmap.new_dnet() scanner.pcap = nmap.new_socket() @@ -531,7 +531,7 @@ -- @return whether the packet seems to be a valid reply or not check = function(src, layer3) local ip = packet.Packet:new(layer3) - return ip.ip6_dst == src + return ip.ip_bin_dst == src and ip.ip_p == packet.IPPROTO_ICMPV6 and ip.icmpv6_type == ICMP_TIME_EXCEEDEDv6 end, @@ -550,8 +550,8 @@ local ip2 = packet.Packet:new(is) -- check ICMP payload - if ip2.ip6_src == scanner.target.bin_ip_src and - ip2.ip6_dst == scanner.target.bin_ip then + if ip2.ip_bin_src == scanner.target.bin_ip_src and + ip2.ip_bin_dst == scanner.target.bin_ip then -- layer 4 checks local proto_func = proto_vtable[proto2str(ip2.ip_p)] Index: scripts/ipv6-node-info.nse =================================================================== --- scripts/ipv6-node-info.nse (revision 27813) +++ scripts/ipv6-node-info.nse (working copy) @@ -248,7 +248,7 @@ if not STRINGIFY[qtype] then -- This is a not a qtype we sent or know about. - stdnse.print_debug(1, "Got NI reply with unknown qtype %d from %s", qtype, packet.toipv6(p.ip6_src)) + stdnse.print_debug(1, "Got NI reply with unknown qtype %d from %s", qtype, p.ip6_src) return end Index: scripts/targets-ipv6-multicast-echo.nse =================================================================== --- scripts/targets-ipv6-multicast-echo.nse (revision 27813) +++ scripts/targets-ipv6-multicast-echo.nse (working copy) @@ -94,8 +94,8 @@ local probe = packet.Frame:new() probe.mac_src = src_mac probe.mac_dst = dst_mac - probe.ip6_src = src_ip6 - probe.ip6_dst = dst_ip6 + probe.ip_bin_src = src_ip6 + probe.ip_bin_dst = dst_ip6 probe.echo_id = 5 probe.echo_seq = 6 probe.echo_data = "Nmap host discovery." @@ -120,7 +120,7 @@ else local reply = packet.Frame:new(layer2..layer3) if reply.mac_dst == src_mac then - local target_str = packet.toipv6(reply.ip6_src) + local target_str = reply.ip_src if not results[target_str] then if target.ALLOW_NEW_TARGETS then target.add(target_str) Index: scripts/targets-ipv6-multicast-invalid-dst.nse =================================================================== --- scripts/targets-ipv6-multicast-invalid-dst.nse (revision 27813) +++ scripts/targets-ipv6-multicast-invalid-dst.nse (working copy) @@ -112,8 +112,8 @@ local probe = packet.Frame:new() probe.mac_src = src_mac probe.mac_dst = dst_mac - probe.ip6_src = src_ip6 - probe.ip6_dst = dst_ip6 + probe.ip_bin_src = src_ip6 + probe.ip_bin_dst = dst_ip6 -- In addition to setting an invalid option in -- build_invalid_extension_header, we set an unknown ICMPv6 type of @@ -152,7 +152,7 @@ local l2reply = packet.Frame:new(layer2) if l2reply.mac_dst == src_mac then local reply = packet.Packet:new(layer3) - local target_str = packet.toipv6(reply.ip6_src) + local target_str = reply.ip_src if not results[target_str] then if target.ALLOW_NEW_TARGETS then target.add(target_str) Index: scripts/targets-ipv6-multicast-slaac.nse =================================================================== --- scripts/targets-ipv6-multicast-slaac.nse (revision 27813) +++ scripts/targets-ipv6-multicast-slaac.nse (working copy) @@ -161,8 +161,8 @@ local probe = packet.Frame:new() - probe.ip6_src = packet.mac_to_lladdr(src_mac) - probe.ip6_dst = dst_ip6 + probe.ip_bin_src = packet.mac_to_lladdr(src_mac) + probe.ip_bin_dst = dst_ip6 probe.mac_src = src_mac probe.mac_dst = packet.mactobin("33:33:00:00:00:01") @@ -192,8 +192,8 @@ local l2reply = packet.Frame:new(layer2) if string.sub(l2reply.mac_dst, 1, 3) == string.sub(expected_mac_dst_prefix, 1, 3) then local reply = packet.Packet:new(layer3) - if reply.ip6_src == expected_ip6_src and - string.sub(expected_ip6_dst_prefix,1,12) == string.sub(reply.ip6_dst,1,12) then + if reply.ip_bin_src == expected_ip6_src and + string.sub(expected_ip6_dst_prefix,1,12) == string.sub(reply.ip_bin_dst,1,12) then local ula_target_addr_str = packet.toipv6(reply.ns_target) local identifier = get_identifier(reply.ns_target) --Filter out the reduplicative identifiers.