Revision: 14836
Author: adrian.chadd
Date: Tue Jan 11 17:18:58 2011
Log: Make the netdbDeleteAddrNetwork() call ipv6-aware, but just ignore non-IPv4 for now.

This removes one of the ipv4-isms from src/comm.c .


http://code.google.com/p/lusca-cache/source/detail?r=14836

Modified:
 /playpen/LUSCA_HEAD_ipv6/src/comm.c
 /playpen/LUSCA_HEAD_ipv6/src/net_db.c
 /playpen/LUSCA_HEAD_ipv6/src/protos.h

=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/comm.c Tue Jan 11 17:04:36 2011
+++ /playpen/LUSCA_HEAD_ipv6/src/comm.c Tue Jan 11 17:18:58 2011
@@ -291,7 +291,7 @@
        cs->tries++;
ipcacheMarkBadAddr(cs->host, sqinet_get_v4_inaddr(&cs->in_addr6, SQADDR_ASSERT_IS_V4));
        if (Config.onoff.test_reachability)
- netdbDeleteAddrNetwork(sqinet_get_v4_inaddr(&cs->in_addr6, SQADDR_ASSERT_IS_V4));
+           netdbDeleteAddrNetwork(&cs->in_addr6);
        if (commRetryConnect(cs)) {
eventAdd("commReconnect", commReconnect, cs, cs->addrcount == 1 ? 0.05 : 0.0, 0);
        } else {
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/net_db.c       Sun Jul  4 06:56:53 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/net_db.c       Tue Jan 11 17:18:58 2011
@@ -913,9 +913,17 @@
 }

 void
-netdbDeleteAddrNetwork(struct in_addr addr)
-{
+netdbDeleteAddrNetwork(sqaddr_t *a)
+{
+#warning netdb needs to be made ipv6 aware!
 #if USE_ICMP
+    struct in_addr addr;
+
+    if (sqinet_get_family(a) != AF_INET)
+       return;
+
+    addr = sqinet_get_v4_inaddr(a, SQADDR_ASSERT_IS_V4);
+
     netdbEntry *n = netdbLookupAddr(addr);
     if (n == NULL)
        return;
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/protos.h       Mon Sep  6 21:35:23 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/protos.h       Tue Jan 11 17:18:58 2011
@@ -400,7 +400,7 @@
 extern int netdbHostHops(const char *host);
 extern int netdbHostRtt(const char *host);
 extern void netdbUpdatePeer(request_t *, peer * e, int rtt, int hops);
-extern void netdbDeleteAddrNetwork(struct in_addr addr);
+extern void netdbDeleteAddrNetwork(sqaddr_t *a);
 extern void netdbBinaryExchange(StoreEntry *);
 extern EVH netdbExchangeStart;
extern void netdbExchangeUpdatePeer(struct in_addr, peer *, double, double);

--
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en.

Reply via email to