Revision: 14882
Author:   adrian.chadd
Date:     Sat Jul  9 19:02:23 2011
Log:      Begin fleshing out getOutgoingAddr6.

acl_address is still v4-only though. This needs to be addressed.


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

Modified:
 /playpen/LUSCA_HEAD_ipv6/src/forward.c

=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/forward.c      Sat Jul  9 08:39:35 2011
+++ /playpen/LUSCA_HEAD_ipv6/src/forward.c      Sat Jul  9 19:02:23 2011
@@ -504,6 +504,30 @@
     return addr;
 }

+/*
+ * This is designed for IPv6 only, but eventually
+ * IPv4/IPv6 lookups should just use this function and
+ * ACL map.
+ */
+static int
+aclMapAddr6(acl_address * head, aclCheck_t * ch, sqaddr_t *a)
+{
+#if 0
+    acl_address *l;
+    struct in_addr addr;
+    aclChecklistCacheInit(ch);
+    for (l = head; l; l = l->next) {
+       if (aclMatchAclList(l->acl_list, ch))
+           return l->addr;
+    }
+    addr.s_addr = INADDR_ANY;
+    return addr;
+#endif
+    sqinet_set_family(a, AF_INET6);
+    sqinet_set_anyaddr(a);
+    return 0;
+}
+
 static int
 aclMapTOS(acl_tos * head, aclCheck_t * ch)
 {
@@ -534,8 +558,13 @@
 void
 getOutgoingAddrV6(request_t * request, sqaddr_t *a)
 {
-       sqinet_set_family(a, AF_INET6);
-       sqinet_set_anyaddr(a);
+    aclCheck_t ch;
+    memset(&ch, '\0', sizeof(ch));
+    aclCheckSetup(&ch);
+    if (request)
+        ch.request = request;
+    (void) aclMapAddr6(Config.accessList.outgoing_address, &ch, a);
+    aclCheckFinish(&ch);
 }

 unsigned long

--
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