Skip to content

Commit

Permalink
apply modified patch from #130 (provided by @schneider42, fix #130)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Feb 14, 2013
1 parent af8db08 commit 36860c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 164 deletions.
1 change: 1 addition & 0 deletions tools/rosgraph/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

<buildtool_depend>catkin</buildtool_depend>

<run_depend>python-netifaces</run_depend>
<run_depend>python-rospkg</run_depend>

<test_depend>python-mock</test_depend>
Expand Down
160 changes: 0 additions & 160 deletions tools/rosgraph/src/rosgraph/ifaddrs.py

This file was deleted.

8 changes: 4 additions & 4 deletions tools/rosgraph/src/rosgraph/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ def get_local_addresses():
except KeyError: pass
elif _is_unix_like_platform():
# unix-only branch
import ifaddrs
ifaces = ifaddrs.getifaddrs()
v4addrs = [addr['addr'] for iface in ifaces.values() if socket.AF_INET in iface for addr in iface[socket.AF_INET]]
v6addrs = [addr['addr'] for iface in ifaces.values() if socket.AF_INET6 in iface for addr in iface[socket.AF_INET6]]
import netifaces
ifaces = netifaces.interfaces()
v4addrs = [addr['addr'] for iface in ifaces if socket.AF_INET in netifaces.ifaddresses(iface) for addr in netifaces.ifaddresses(iface)[socket.AF_INET]]
v6addrs = [addr['addr'] for iface in ifaces if socket.AF_INET6 in netifaces.ifaddresses(iface) for addr in netifaces.ifaddresses(iface)[socket.AF_INET6]]
if use_ipv6():
return v6addrs + v4addrs
else:
Expand Down

0 comments on commit 36860c3

Please sign in to comment.