Browse Source

Improve the detection of localhost interfaces for the HTTP test suite

Ali Sabil 12 years ago
parent
commit
809dc32339
1 changed files with 3 additions and 3 deletions
  1. 3 3
      test/http_SUITE.erl

+ 3 - 3
test/http_SUITE.erl

@@ -422,9 +422,9 @@ body_to_chunks(ChunkSize, Body, Acc) ->
 
 
 get_mtu() ->
 get_mtu() ->
 	{ok, Interfaces} = inet:getiflist(),
 	{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),
 	end, Interfaces),
 	{ok, [{mtu, MTU}]} = inet:ifget(LocalInterface, [mtu]),
 	{ok, [{mtu, MTU}]} = inet:ifget(LocalInterface, [mtu]),
 	MTU.
 	MTU.