[hipl-commit] [update] Rev 494: Started shotgun for UPDATE. Does not work properly yet.

  • From: Miika Komu <miika@xxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Wed, 3 Mar 2010 19:09:08 +0200

Committer: Miika Komu <miika@xxxxxx>
Date: Wed Mar 03 19:09:07 2010 +0200
Revision: 494
Revision-id: miika@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: update

Log:
  Started shotgun for UPDATE. Does not work properly yet.

Modified:
  M  hipd/update.c

=== modified file 'hipd/update.c'
--- hipd/update.c       2010-03-03 15:59:44 +0000
+++ hipd/update.c       2010-03-03 17:09:07 +0000
@@ -317,10 +317,33 @@
         goto out_err;
     }
 
-    if (hip_shotgun_status == SO_HIP_SHOTGUN_OFF) {
+    if (hip_shotgun_status == SO_HIP_SHOTGUN_ON && type == HIP_UPDATE_LOCATOR) 
{
+#if 0
+        /* @todo this does not work yet properly */
+        hip_list_t *item = NULL, *tmp = NULL;
+        struct hip_peer_addr_list_item *addr;
+        struct in6_addr peer_addr;
+        int i = 0;
+        /* @todo add an extra loop to go though the local addresses */
+        list_for_each_safe(item, tmp, ha->peer_addresses_old, i) {
+            addr = (struct hip_peer_addr_list_item *) list_entry(item);
+            ipv6_addr_copy(&peer_addr, &addr->address);
+
+            /* @todo check check_if_address_peer_ok ?? */
+
+            HIP_DEBUG("Sending UPDATE from default route (XX FIXME)\n");
+            HIP_DEBUG_IN6ADDR("to", &peer_addr);
+
+            hip_send_update_pkt(update_packet_to_send, ha,
+                                NULL, &peer_addr);
+            }
+#endif
+    } else {
         switch (type) {
         case HIP_UPDATE_LOCATOR:
-            HIP_IFEL(hip_select_local_addr_for_first_update(ha, src_addr, 
dst_addr, &local_addr), -1,
+            HIP_IFEL(hip_select_local_addr_for_first_update(ha, src_addr,
+                                                            dst_addr,
+                                                            &local_addr), -1,
                      "No source address found for first update\n");
             HIP_DEBUG_IN6ADDR("Sending update from", &local_addr);
             HIP_DEBUG_IN6ADDR("to", dst_addr);
@@ -334,9 +357,8 @@
             HIP_DEBUG_IN6ADDR("to", dst_addr);
 
             hip_send_update_pkt(update_packet_to_send, ha, src_addr,
-                                dst_addr);
-
-            break;
+                            dst_addr);
+        break;
         case HIP_UPDATE_ECHO_REQUEST:
             list_for_each_safe(item, tmp, ha->addresses_to_send_echo_request, 
i) {
                 dst_addr = (struct in6_addr *) list_entry(item);
@@ -345,7 +367,7 @@
                 _HIP_DEBUG_IN6ADDR("to", dst_addr);
 
                 if (!are_addresses_compatible(src_addr, dst_addr)) {
-                    continue;
+                  continue;
                 }
 
                 HIP_DEBUG_IN6ADDR("Sending echo requests from", src_addr);
@@ -354,7 +376,6 @@
                 hip_send_update_pkt(update_packet_to_send, ha,
                                     src_addr, dst_addr);
             }
-
             break;
         case SEND_UPDATE_ESP_ANCHOR:
             // TODO re-implement sending of esp prot anchors
@@ -363,18 +384,6 @@
             break;
         }
     }
-    // TODO
-    /*else
-     * {
-     *  for go through all local addressses
-     *  {
-     *      for go through all peer addresses
-     *      {
-     *          if (check_if_address_peer_ok)
-     *              send_update_pkt()
-     *      }
-     *  }
-     * }*/
 
 out_err:
     if (update_packet_to_send) {

Other related posts:

  • » [hipl-commit] [update] Rev 494: Started shotgun for UPDATE. Does not work properly yet. - Miika Komu