Bug 1576226

Summary: nping --ipv6 (ipv6 mode) don't echo reply packet , alway echo packets Lost(100%).
Product: Red Hat Enterprise Linux 7 Reporter: yiche <yiche>
Component: nmapAssignee: aegorenk
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 7.5CC: aegorenk, pzhukov, thozza
Target Milestone: rcKeywords: Patch, TestCaseNeeded, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-23 12:36:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1630905, 1757052    

Description yiche 2018-05-09 06:15:45 UTC
Description of problem:
1.nping in ipv6 mode send tcp packet always get "Lost" result,even thougt tcpdump can capture a [R.] reply packet.
2.nping --ipv6 can't really send a packet without adding -e <interface> option.This is different behaver from ipv4 mode.

Version-Release number of selected component (if applicable):
Nping version 0.6.40
nmap-6.40-13.el7.src.rpm

How reproducible:
always

Steps to Reproduce:
1. #tcpdump -i lo
   
   #nping -6 -c1 --tcp --dest-port 9999 --dest-ip ::1
   
   tcpdump get nothing.
   
   #nping -6 -c1 --tcp --dest-port 9999 --dest-ip ::1 -e lo
   
   tcpdump captured:
01:51:23.584539 IP6 localhost.domaintime > localhost.distinct: Flags [S], seq 419356979, win 1480, length 0
01:51:23.584553 IP6 localhost.distinct > localhost.domaintime: Flags [R.], seq 0, ack 2756775218, win 0, length 0

   but nping says:
SENT (0.2426s) TCP :::9909 > ::1:9999 S seq=2929069004 win=1480 
 
Max rtt: N/A | Min rtt: N/A | Avg rtt: N/A
Raw packets sent: 1 (20B) | Rcvd: 0 (0B) | Lost: 1 (100.00%)
Nping done: 1 IP address pinged in 1.26 seconds


2.As a compare in ipv4 mode:
   #nping -c1 --tcp --dest-port 9999 --dest-ip 127.0.0.1

   tcpdump captured:
   02:08:59.121491 IP localhost.domaintime > localhost.distinct: Flags [S], seq 2217048005, win 1480, length 0
02:08:59.121509 IP localhost.distinct > localhost.domaintime: Flags [R.], seq 0, ack 1385936638, win 0, length 0
   
   nping get result as expected:
SENT (0.0202s) TCP 127.0.0.1:9909 > 127.0.0.1:9999 S ttl=64 id=36556 iplen=40  seq=2217048005 win=1480 
RCVD (0.0203s) TCP 127.0.0.1:9999 > 127.0.0.1:9909 RA ttl=64 id=14364 iplen=40  seq=0 win=0 
 
Max rtt: 0.048ms | Min rtt: 0.048ms | Avg rtt: 0.048ms
Raw packets sent: 1 (40B) | Rcvd: 1 (40B) | Lost: 0 (0.00%)
Nping done: 1 IP address pinged in 1.03 seconds

   

Actual results:
nping is too weak in ipv6 mode

Expected results:
nping is a lovely tool we hope it has more power in ipv6

Additional info:

Comment 6 aegorenk 2020-05-04 12:30:37 UTC
PR created in upstream:
https://github.com/nmap/nmap/pull/2033