aboutsummaryrefslogtreecommitdiffstats
path: root/test/http_SUITE.erl
diff options
context:
space:
mode:
authorAli Sabil <[email protected]>2013-06-10 09:53:32 +0200
committerAli Sabil <[email protected]>2013-06-10 09:53:32 +0200
commit809dc32339aedbee63c64e23461c60e207ee53a7 (patch)
tree2a165a4636628774439408a7f6335a189ca2ae9e /test/http_SUITE.erl
parentfdd67b72a37bb712c5707072464ce0b1a200380c (diff)
downloadcowboy-809dc32339aedbee63c64e23461c60e207ee53a7.tar.gz
cowboy-809dc32339aedbee63c64e23461c60e207ee53a7.tar.bz2
cowboy-809dc32339aedbee63c64e23461c60e207ee53a7.zip
Improve the detection of localhost interfaces for the HTTP test suite
Diffstat (limited to 'test/http_SUITE.erl')
-rw-r--r--test/http_SUITE.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index 9470f44..01da7b2 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -422,9 +422,9 @@ body_to_chunks(ChunkSize, Body, Acc) ->
get_mtu() ->
{ok, Interfaces} = inet:getiflist(),
- [LocalInterface | _] = lists:filter(fun
- ("lo" ++ _) -> true;
- (_) -> false
+ [LocalInterface | _ ] = lists:filter(fun(Interface) ->
+ {ok, [{flags, Flags}]} = inet:ifget(Interface, [flags]),
+ lists:member(loopback, Flags)
end, Interfaces),
{ok, [{mtu, MTU}]} = inet:ifget(LocalInterface, [mtu]),
MTU.