Bug #2292
closed
Infinite loop when listNetworkInterfaces returns an address that is either 0.0.0.0 or ::
Added by Alex Afanasyev almost 10 years ago.
Updated almost 10 years ago.
Description
In some configurations, listNetworkInterfaces() returns 0.0.0.0 or ::, which causes infinite loop inside TcpFactory and UdpFactory
What configuration could cause listNetworkInterfaces
to return ANY address?
What's the output of ip addr
and ifconfig
on such configuration?
This Bug should probably blame listNetworkInterfaces
.
I think 0.0.0.0 can be legitimately returned when IPv4 is not configured on the interface.
In any case. I was getting this when playing with cygwin. I will mention it again later in a separate place, but I was able to compile ndn-cxx, NFD, and run NFD on windows in cygwin environment.
Commit f0fda37fea04f15609897bf0e43d259569828c4a is a correct solution to this Bug.
In addition to this, listNetworkInterfaces
should not add ANY address into NetworkInterfaceInfo::ipv4Addresses
and NetworkInterfaceInfo::ipv6Addresses
when IPv4/IPv6 is not configured. Instead, these vectors shall be left empty.
I suggest making this change in a separate commit under this Bug.
Junxiao Shi wrote:
In addition to this, listNetworkInterfaces
should not add ANY address into NetworkInterfaceInfo::ipv4Addresses
and NetworkInterfaceInfo::ipv6Addresses
when IPv4/IPv6 is not configured. Instead, these vectors shall be left empty.
I don't think I agree with this. listNetworkInterfaces
should simply return whatever is configured on the system, it's just a helper. If an interface on the system has an address of 0.0.0.0
or ::
, listNetworkInterfaces
should return it and not perform any mangling. If a consumer of the listNetworkInterfaces
API is unable to deal with such an address, it's the consumer's bug, not listNetworkInterfaces
's.
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
I think I agree with Davide. Whatever system is returning, should be returned by listNetworkInterfaces and the caller needs to process that in some way.
I'm not planning any more work on this issue.
Then add a \warning
on listNetworkInterfaces
that invalid IP address may be returned.
I don't think 0.0.0.0
qualifies as "invalid". (well, it depends on how you define "invalid"...)
- Status changed from Feedback to Closed
Also available in: Atom
PDF