roswtf warns on hostname that resolves to 127.0.1.1 when 127.0.0.1 is a local IP

asked 2021-03-04 19:23:59 -0500

lucasw gravatar image

updated 2021-03-04 19:24:28 -0500

If I set my ROS_HOSTNAME to be the same as what is in /etc/hostname, and /etc/hosts sets that to 127.0.1.1, roswtf warns:

WARNING ROS_HOSTNAME may be incorrect: ROS_HOSTNAME [mypc] resolves to [127.0.1.1], which does not appear to be a local IP address ['127.0.0.1', '192...

It appears to be fine on localhost, and also appears to be fine if every other computer on the ros network can resolve mypc (and in my case they do so via /etc/hosts entries in each of those other computers). But if there is something wrong and performance under load could be reduced, if extra copies of packets are being made or bandwidth is more limited then the warning is useful.

This answer suggests the warning is wrong https://serverfault.com/questions/363... , if so it ought to be modified to accept any ROS_HOSTNAME that resolves to 127.a.b.c (or ROS_IP) to any 127.x.y.z in the list of local IP addresses, have special logic just for 127? (I'm fine making that PR myself)

edit retag flag offensive close merge delete