=== modified file 'src/icp_v2.cc'
--- src/icp_v2.cc	2011-07-16 15:21:48 +0000
+++ src/icp_v2.cc	2011-07-25 14:45:17 +0000
@@ -746,73 +746,77 @@
         Comm::SetSelect(icpOutgoingConn->fd, COMM_SELECT_READ, icpHandleUdp, NULL, 0);
         fd_note(icpOutgoingConn->fd, "Outgoing ICP socket");
         icpGetOutgoingIpAddress();
     }
 }
 
 // Ensure that we have the IP address(es) to use for Host ID.
 // The outgoing address is used as 'private' host ID used only on packets we send
 static void
 icpGetOutgoingIpAddress()
 {
     struct addrinfo *xai = NULL;
     theIcpPrivateHostID.SetEmpty();
     theIcpPrivateHostID.InitAddrInfo(xai);
     if (getsockname(icpOutgoingConn->fd, xai->ai_addr, &xai->ai_addrlen) < 0)
         debugs(50, DBG_IMPORTANT, "ERROR: Unable to identify ICP host ID to use for " << icpOutgoingConn
                << ": getsockname: " << xstrerror());
     else
         theIcpPrivateHostID = *xai;
     theIcpPrivateHostID.FreeAddrInfo(xai);
+
+    theIcpPrivateHostID.SetIPv4();
 }
 
 static void
 icpIncomingConnectionOpened(int errNo)
 {
     if (!Comm::IsConnOpen(icpIncomingConn))
         fatal("Cannot open ICP Port");
 
     Comm::SetSelect(icpIncomingConn->fd, COMM_SELECT_READ, icpHandleUdp, NULL, 0);
 
     for (const wordlist *s = Config.mcast_group_list; s; s = s->next)
         ipcache_nbgethostbyname(s->key, mcastJoinGroups, NULL); // XXX: pass the icpIncomingConn for mcastJoinGroups usage.
 
     debugs(12, DBG_IMPORTANT, "Accepting ICP messages on " << icpIncomingConn->local);
 
     fd_note(icpIncomingConn->fd, "Incoming ICP port");
 
     if (Config.Addrs.udp_outgoing.IsNoAddr()) {
         icpOutgoingConn = icpIncomingConn;
         debugs(12, DBG_IMPORTANT, "Sending ICP messages from " << icpOutgoingConn->local);
         icpGetOutgoingIpAddress();
     }
 
     // Ensure that we have the IP address(es) to use for Host ID.
     // The listening address is used as 'public' host ID which can be used to contact us
     struct addrinfo *xai = NULL;
     theIcpPublicHostID.InitAddrInfo(xai); // reset xai
     if (getsockname(icpIncomingConn->fd, xai->ai_addr, &xai->ai_addrlen) < 0)
         debugs(50, DBG_IMPORTANT, "ERROR: Unable to identify ICP host ID to use for " << icpIncomingConn
                << ": getsockname: " << xstrerror());
     else
         theIcpPublicHostID = *xai;
     theIcpPublicHostID.FreeAddrInfo(xai);
+    
+    theIcpPublicHostID.SetIPv4();
 }
 
 /**
  * icpConnectionShutdown only closes the 'in' socket if it is
  * different than the 'out' socket.
  */
 void
 icpConnectionShutdown(void)
 {
     if (!Comm::IsConnOpen(icpIncomingConn))
         return;
 
     debugs(12, DBG_IMPORTANT, "Stop receiving ICP on " << icpIncomingConn->local);
 
     /** Release the 'in' socket for lazy closure.
      * in and out sockets may be sharing one same FD.
      * This prevents this function from executing repeatedly.
      */
     icpIncomingConn = NULL;
 

=== modified file 'src/neighbors.cc'
--- src/neighbors.cc	2011-07-20 07:35:53 +0000
+++ src/neighbors.cc	2011-07-25 13:46:23 +0000
@@ -555,41 +555,42 @@
 
                 debugs(15, DBG_IMPORTANT, "         Ignoring " <<
                        neighborTypeStr(thisPeer) << " " << thisPeer->host <<
                        "/" << thisPeer->http_port << "/" <<
                        thisPeer->icp.port);
 
                 neighborRemove(thisPeer);
             }
         }
     }
 
     peerRefreshDNS((void *) 1);
 
     if (echo_hdr.opcode == ICP_INVALID) {
         echo_hdr.opcode = ICP_SECHO;
         echo_hdr.version = ICP_VERSION_CURRENT;
         echo_hdr.length = 0;
         echo_hdr.reqnum = 0;
         echo_hdr.flags = 0;
         echo_hdr.pad = 0;
-        theIcpPublicHostID.GetInAddr( *((struct in_addr*)&echo_hdr.shostid) );
+        //theIcpPublicHostID.GetInAddr( *((struct in_addr*)&echo_hdr.shostid) );
+        echo_hdr.shostid = 0; 
         sep = getservbyname("echo", "udp");
         echo_port = sep ? ntohs((u_short) sep->s_port) : 7;
     }
 
     first_ping = Config.peers;
 }
 
 int
 neighborsUdpPing(HttpRequest * request,
                  StoreEntry * entry,
                  IRCB * callback,
                  void *callback_data,
                  int *exprep,
                  int *timeout)
 {
     const char *url = entry->url();
     MemObject *mem = entry->mem_obj;
     peer *p = NULL;
     int i;
     int reqnum = 0;


