Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ping] Target IP address is invalid for the given af #4

Closed
bortzmeyer opened this issue Nov 13, 2017 · 4 comments
Closed

[ping] Target IP address is invalid for the given af #4

bortzmeyer opened this issue Nov 13, 2017 · 4 comments
Labels

Comments

@bortzmeyer
Copy link

% ./atlas ping 104.20.0.85 
2017/11/13 23:38:59 req=&atlas.MeasurementRequest{Definitions:[]atlas.Definition{atlas.Definition{Description:"Ping - 104.20.0.85", Type:"ping", AF:4, Target:"104.20.0.85", GroupID:0, Group:"", InWifiGroup:false, Spread:0, Packets:0, PacketInterval:0, ExtraWait:0, IsOneoff:false, IsPublic:false, ResolveOnProbe:false, Interval:0, Protocol:"", QueryClass:"", QueryType:"", QueryArgument:"", Retry:0, SetCDBit:false, SetDOBit:false, SetNSIDBit:false, SetRDBit:false, UDPPayloadSize:0, UseProbeResolver:false, DestinationOptionSize:0, DontFragment:false, DuplicateTimeout:0, FirstHop:0, HopByHopOptionSize:0, MaxHops:0, Paris:0, ExtendedTiming:false, HeaderBytes:0, Method:"", MoreExtendedTiming:false, Path:"", QueryOptions:"", UserAgent:"", Version:"", Port:0, Size:0, AnonymousIdentity:"", Cert:"", EAP:""}, atlas.Definition{Description:"Ping - 104.20.0.85", Type:"ping", AF:6, Target:"104.20.0.85", GroupID:0, Group:"", InWifiGroup:false, Spread:0, Packets:0, PacketInterval:0, ExtraWait:0, IsOneoff:false, IsPublic:false, ResolveOnProbe:false, Interval:0, Protocol:"", QueryClass:"", QueryType:"", QueryArgument:"", Retry:0, SetCDBit:false, SetDOBit:false, SetNSIDBit:false, SetRDBit:false, UDPPayloadSize:0, UseProbeResolver:false, DestinationOptionSize:0, DontFragment:false, DuplicateTimeout:0, FirstHop:0, HopByHopOptionSize:0, MaxHops:0, Paris:0, ExtendedTiming:false, HeaderBytes:0, Method:"", MoreExtendedTiming:false, Path:"", QueryOptions:"", UserAgent:"", Version:"", Port:0, Size:0, AnonymousIdentity:"", Cert:"", EAP:""}}, Probes:atlas.ProbeSet{struct { Requested int "json:\"requested\""; Type string "json:\"type\""; Value string "json:\"value\""; Tags map[string]string "json:\"tags,omitempty\"" }{Requested:10, Type:"area", Value:"WW", Tags:map[string]string(nil)}}, BillTo:0, IsOneoff:true, SkipDNSCheck:false, Times:0, StartTime:0, StopTime:0}
err: status: 400 code: 102 - r:There was a problem with your request
errors: [{{/definitions/1/target} Target IP address is invalid for the given `af`}]

OK, why does it believe it may be an IPv6 address? And how to force it to regard it as IPv4? Which command-line option?

% ./atlas ping -h  
NAME:
   atlas ping - ping selected address

USAGE:
   atlas ping [arguments...]

DESCRIPTION:
   send echo/reply to an IP

Anyway, it also fails with an IPv6 address:

% ./atlas ping 2400:cb00:2048:1::6814:55
2017/11/13 23:41:02 req=&atlas.MeasurementRequest{Definitions:[]atlas.Definition{atlas.Definition{Description:"Ping - 2400:cb00:2048:1::6814:55", Type:"ping", AF:4, Target:"2400:cb00:2048:1::6814:55", GroupID:0, Group:"", InWifiGroup:false, Spread:0, Packets:0, PacketInterval:0, ExtraWait:0, IsOneoff:false, IsPublic:false, ResolveOnProbe:false, Interval:0, Protocol:"", QueryClass:"", QueryType:"", QueryArgument:"", Retry:0, SetCDBit:false, SetDOBit:false, SetNSIDBit:false, SetRDBit:false, UDPPayloadSize:0, UseProbeResolver:false, DestinationOptionSize:0, DontFragment:false, DuplicateTimeout:0, FirstHop:0, HopByHopOptionSize:0, MaxHops:0, Paris:0, ExtendedTiming:false, HeaderBytes:0, Method:"", MoreExtendedTiming:false, Path:"", QueryOptions:"", UserAgent:"", Version:"", Port:0, Size:0, AnonymousIdentity:"", Cert:"", EAP:""}, atlas.Definition{Description:"Ping - 2400:cb00:2048:1::6814:55", Type:"ping", AF:6, Target:"2400:cb00:2048:1::6814:55", GroupID:0, Group:"", InWifiGroup:false, Spread:0, Packets:0, PacketInterval:0, ExtraWait:0, IsOneoff:false, IsPublic:false, ResolveOnProbe:false, Interval:0, Protocol:"", QueryClass:"", QueryType:"", QueryArgument:"", Retry:0, SetCDBit:false, SetDOBit:false, SetNSIDBit:false, SetRDBit:false, UDPPayloadSize:0, UseProbeResolver:false, DestinationOptionSize:0, DontFragment:false, DuplicateTimeout:0, FirstHop:0, HopByHopOptionSize:0, MaxHops:0, Paris:0, ExtendedTiming:false, HeaderBytes:0, Method:"", MoreExtendedTiming:false, Path:"", QueryOptions:"", UserAgent:"", Version:"", Port:0, Size:0, AnonymousIdentity:"", Cert:"", EAP:""}}, Probes:atlas.ProbeSet{struct { Requested int "json:\"requested\""; Type string "json:\"type\""; Value string "json:\"value\""; Tags map[string]string "json:\"tags,omitempty\"" }{Requested:10, Type:"area", Value:"WW", Tags:map[string]string(nil)}}, BillTo:0, IsOneoff:true, SkipDNSCheck:false, Times:0, StartTime:0, StopTime:0}
err: status: 400 code: 102 - r:There was a problem with your request
errors: [{{/definitions/0/target} Target IP address is invalid for the given `af`}]
@bortzmeyer
Copy link
Author

OK, -h has to be used only before the command name. So, I use the -6 option and it works:

% ./atlas -6 ping  2400:cb00:2048:1::6814:55
2017/11/14 00:19:14 req=&atlas.MeasurementRequest{Definitions:[]atlas.Definition{atlas.Definition{Description:"Ping - 2400:cb00:2048:1::6814:55", Type:"ping", AF:6, Target:"2400:cb00:2048:1::6814:55", GroupID:0, Group:"", InWifiGroup:false, Spread:0, Packets:0, PacketInterval:0, ExtraWait:0, IsOneoff:false, IsPublic:false, ResolveOnProbe:false, Interval:0, Protocol:"", QueryClass:"", QueryType:"", QueryArgument:"", Retry:0, SetCDBit:false, SetDOBit:false, SetNSIDBit:false, SetRDBit:false, UDPPayloadSize:0, UseProbeResolver:false, DestinationOptionSize:0, DontFragment:false, DuplicateTimeout:0, FirstHop:0, HopByHopOptionSize:0, MaxHops:0, Paris:0, ExtendedTiming:false, HeaderBytes:0, Method:"", MoreExtendedTiming:false, Path:"", QueryOptions:"", UserAgent:"", Version:"", Port:0, Size:0, AnonymousIdentity:"", Cert:"", EAP:""}}, Probes:atlas.ProbeSet{struct { Requested int "json:\"requested\""; Type string "json:\"type\""; Value string "json:\"value\""; Tags map[string]string "json:\"tags,omitempty\"" }{Requested:10, Type:"area", Value:"WW", Tags:map[string]string(nil)}}, BillTo:0, IsOneoff:true, SkipDNSCheck:false, Times:0, StartTime:0, StopTime:0}
m: &{[10185594]}
resp: "{\"measurements\":[10185594]}"
d: &{[{Ping - 2400:cb00:2048:1::6814:55 ping 6 2400:cb00:2048:1::6814:55 0  false 0 0 0 0 false false false 0     0 false false false false 0 false 0 false 0 0 0 0 0 false 0  false     0 0   }] [{10 area WW map[]}] 0 true false 0 0 0}
m: &{[10185594]}

But there is still the problem: why atlas, by default, always make the wrong choice?

@keltia keltia added the bug label Nov 14, 2017
@keltia
Copy link
Owner

keltia commented Nov 14, 2017

By default, atlas sends both IPv4 and IPv6 requests and it fails with IPv4 (as expected). This is something I need to revisit (like making -4 & -6 command-dependent).

@keltia
Copy link
Owner

keltia commented Nov 14, 2017

I believe I fixed this in 7acea93, thanks.

@keltia keltia closed this as completed Nov 14, 2017
@bortzmeyer
Copy link
Author

I confirm it now works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants