Mercurial Hosting > luan
diff src/luan/modules/IoLuan.java @ 1698:2dbcc8360a3e
backup security
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 27 Jun 2022 20:51:49 -0600 |
parents | 8f38abaf779f |
children | 745f756e719b |
line wrap: on
line diff
--- a/src/luan/modules/IoLuan.java Mon Jun 27 18:36:56 2022 -0600 +++ b/src/luan/modules/IoLuan.java Mon Jun 27 20:51:49 2022 -0600 @@ -22,10 +22,8 @@ import java.net.URL; import java.net.InetAddress; import java.net.Inet4Address; -import java.net.NetworkInterface; import java.net.MalformedURLException; import java.net.UnknownHostException; -import java.util.Enumeration; import java.util.Map; import javax.naming.NamingException; import javax.naming.NameNotFoundException; @@ -642,13 +640,9 @@ public static LuanTable my_ips(Luan luan) throws IOException, LuanException { LuanTable tbl = new LuanTable(); - for( Enumeration<NetworkInterface> e1 = NetworkInterface.getNetworkInterfaces(); e1.hasMoreElements(); ) { - NetworkInterface ni = e1.nextElement(); - for( Enumeration<InetAddress> e2 = ni.getInetAddresses(); e2.hasMoreElements(); ) { - InetAddress ia = e2.nextElement(); - if( ia instanceof Inet4Address ) - tbl.put(luan,ia.getHostAddress(),true); - } + for( InetAddress ia : IoUtils.getInetAddresses() ) { + if( ia instanceof Inet4Address ) + tbl.put(luan,ia.getHostAddress(),true); } return tbl; }