~tritone-team/tritone/eucalyptus

« back to all changes in this revision

Viewing changes to clc/modules/core/src/main/java/com/eucalyptus/util/DNSProperties.java

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland
  • Date: 2009-12-01 21:09:28 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: james.westby@ubuntu.com-20091201210928-o2dvg0ubljhb0ft6
Tags: upstream-1.6.1~bzr1083
ImportĀ upstreamĀ versionĀ 1.6.1~bzr1083

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
                List<NetworkInterface> ifaces = null;
105
105
                try {
106
106
                        ifaces = Collections.list( NetworkInterface.getNetworkInterfaces() );
107
 
                }
108
 
                catch ( SocketException e1 ) {}
109
 
 
110
 
                for ( NetworkInterface iface : ifaces )
111
 
                        try {
112
 
                                if ( !iface.isLoopback() && !iface.isVirtual() && iface.isUp() ) {
113
 
                                        for ( InetAddress iaddr : Collections.list( iface.getInetAddresses() ) ) {
114
 
                                                if ( !iaddr.isSiteLocalAddress() && !( iaddr instanceof Inet6Address) ) {
115
 
                                                        ipAddr = iaddr;
116
 
                                                } else if ( iaddr.isSiteLocalAddress() && !( iaddr instanceof Inet6Address ) ) {
117
 
                                                        ipAddr = iaddr;
 
107
                        for ( NetworkInterface iface : ifaces )
 
108
                                try {
 
109
                                        if ( !iface.isLoopback() && !iface.isVirtual() && iface.isUp() ) {
 
110
                                                for ( InetAddress iaddr : Collections.list( iface.getInetAddresses() ) ) {
 
111
                                                        if ( !iaddr.isSiteLocalAddress() && !( iaddr instanceof Inet6Address) ) {
 
112
                                                                ipAddr = iaddr;
 
113
                                                        } else if ( iaddr.isSiteLocalAddress() && !( iaddr instanceof Inet6Address ) ) {
 
114
                                                                ipAddr = iaddr;
 
115
                                                        }
118
116
                                                }
119
117
                                        }
120
118
                                }
121
 
                        }
 
119
                        catch ( SocketException e1 ) {}
 
120
                }
122
121
                catch ( SocketException e1 ) {}
123
 
 
124
122
                if(ipAddr != null) {
125
123
                        DNSProperties.NS_IP = ipAddr.getHostAddress();
126
124
                        DNSProperties.NS_HOST = ipAddr.getCanonicalHostName();