Permalink
Browse files

handle IPv6 addresses in <client><ip value="XXX">...

  • Loading branch information...
nniclausse committed Dec 1, 2011
1 parent 19df298 commit 7cc8e685a51d62f88286c7148eb8803054661494
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/tsung_controller/ts_config.erl
@@ -268,7 +268,12 @@ parse(Element = #xmlElement{name=ip, attributes=Attrs},
StrIP
end,
?LOGF("resolving host ~p~n",[ToResolve],?WARN),
- {ok,IPtmp} = inet:getaddr(ToResolve,inet),
+ {ok,IPtmp} = case inet:getaddr(ToResolve,inet) of
+ {error,nxdomain} -> % retry with IPv6
+ inet:getaddr(ToResolve,inet6);
+ Val ->
+ Val
+ end,
IPtmp
end,
?LOGF("resolved host ~p~n",[IP],?WARN),

0 comments on commit 7cc8e68

Please sign in to comment.