diff options
author | Micael Karlberg <[email protected]> | 2019-07-08 16:45:34 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-07-08 16:45:34 +0200 |
commit | cc57fe8aa7c98c2c3df3d4ea7304c9b53bea1694 (patch) | |
tree | 906b1e6ef02af525ffdd1e3817b9b23f22d03abb | |
parent | ea41f795b8e3b18051fdb502fc597caf559ebc4c (diff) | |
parent | e6226c6741f336b4c0f2d5b4c930be2fcd9c3737 (diff) | |
download | otp-cc57fe8aa7c98c2c3df3d4ea7304c9b53bea1694.tar.gz otp-cc57fe8aa7c98c2c3df3d4ea7304c9b53bea1694.tar.bz2 otp-cc57fe8aa7c98c2c3df3d4ea7304c9b53bea1694.zip |
Merge branch 'maint'
-rw-r--r-- | erts/emulator/test/socket_SUITE.erl | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/erts/emulator/test/socket_SUITE.erl b/erts/emulator/test/socket_SUITE.erl index 3fab6b98a8..b80cc794e7 100644 --- a/erts/emulator/test/socket_SUITE.erl +++ b/erts/emulator/test/socket_SUITE.erl @@ -8114,13 +8114,22 @@ which_multicast_address(Domain) -> %% SunOS: IfName - Group - RefCnt which_multicast_address2(Domain, WhichMAddr) -> - IfName = which_local_host_ifname(Domain), - NetstatGroupsStr = os:cmd("netstat -g | grep " ++ IfName), - NetstatGroups0 = string:tokens(NetstatGroupsStr, [$\n]), - NetstatGroups = [string:tokens(G, [$ ]) || G <- NetstatGroups0], - MAddrs = [WhichMAddr(NetstatGroup) || NetstatGroup <- - NetstatGroups], - which_multicast_address3(Domain, MAddrs). + IfName = which_local_host_ifname(Domain), + try + begin + %% On some platforms the netstat barfs out some crap on stderr + %% before the actual info... + NetstatGroupsStr = os:cmd("netstat -g 2>/dev/null | grep " ++ IfName), + NetstatGroups0 = string:tokens(NetstatGroupsStr, [$\n]), + NetstatGroups = [string:tokens(G, [$ ]) || G <- NetstatGroups0], + MAddrs = [WhichMAddr(NetstatGroup) || NetstatGroup <- + NetstatGroups], + which_multicast_address3(Domain, MAddrs) + end + catch + C:E:S -> + not_supported({multicast, {C,E,S}}) + end. which_multicast_address3(_Domain, []) -> not_supported({multicast, no_valid_addrs}); |