veyron/runtimes/google/ipc: Skip IP address rewrite when listening on proxy

When the server is listening on the proxy, the endpoint comes from the
proxy itself and we shouldn't try to rewrite it. The current code
actually fails if the endpoint returned by the proxy contains a hostname
instead of an IP address.

Change-Id: Ib2d162155306c22f29cd9cb9fa14a015fd57ad70
diff --git a/runtimes/google/ipc/server.go b/runtimes/google/ipc/server.go
index a737391..c5a0b4a 100644
--- a/runtimes/google/ipc/server.go
+++ b/runtimes/google/ipc/server.go
@@ -157,27 +157,29 @@
 		return nil, fmt.Errorf("ipc: Listen on %v %v failed translating internal endpoint data types", protocol, address)
 	}
 
-	// We know the endpoint format, so we crack it open...
-	switch iep.Protocol {
-	case "tcp", "tcp4", "tcp6":
-		host, port, err := net.SplitHostPort(iep.Address)
-		if err != nil {
-			return nil, err
-		}
-		ip := net.ParseIP(host)
-		if ip == nil {
-			return nil, fmt.Errorf("ipc: Listen(%q, %q) failed to parse IP address from address", protocol, address)
-		}
-		if ip.IsUnspecified() && s.preferredAddress != nil {
-			// Need to find a usable IP address.
-			addrs, err := netstate.GetAccessibleIPs()
-			if err == nil {
-				if a, err := s.preferredAddress(protocol, addrs); err == nil {
-					if ip := netstate.AsIP(a); ip != nil {
-						// a may be an IPNet or an IPAddr under the covers,
-						// but we really want the IP portion without any
-						// netmask so we use AsIP to ensure that.
-						iep.Address = net.JoinHostPort(ip.String(), port)
+	if protocol != inaming.Network {
+		// We know the endpoint format, so we crack it open...
+		switch iep.Protocol {
+		case "tcp", "tcp4", "tcp6":
+			host, port, err := net.SplitHostPort(iep.Address)
+			if err != nil {
+				return nil, err
+			}
+			ip := net.ParseIP(host)
+			if ip == nil {
+				return nil, fmt.Errorf("ipc: Listen(%q, %q) failed to parse IP address from address", protocol, address)
+			}
+			if ip.IsUnspecified() && s.preferredAddress != nil {
+				// Need to find a usable IP address.
+				addrs, err := netstate.GetAccessibleIPs()
+				if err == nil {
+					if a, err := s.preferredAddress(protocol, addrs); err == nil {
+						if ip := netstate.AsIP(a); ip != nil {
+							// a may be an IPNet or an IPAddr under the covers,
+							// but we really want the IP portion without any
+							// netmask so we use AsIP to ensure that.
+							iep.Address = net.JoinHostPort(ip.String(), port)
+						}
 					}
 				}
 			}