[pisa-src] r2408 - in trunk: pisacd/cdregister.c pisasd/sdregister.c

  • From: Hanno Wirtz <Hanno.Wirtz@xxxxxxxxxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Thu, 06 Jan 2011 18:45:39 +0100

Author: wirtz
Date: Thu Jan  6 18:45:38 2011
New Revision: 2408

Log:
added check whether connection endpoint is a valid HIT, 
instead of only an ipv6-address

Modified:
   trunk/pisacd/cdregister.c
   trunk/pisasd/sdregister.c

Modified: trunk/pisacd/cdregister.c
==============================================================================
--- trunk/pisacd/cdregister.c   Thu Dec 30 23:10:54 2010        (r2407)
+++ trunk/pisacd/cdregister.c   Thu Jan  6 18:45:38 2011        (r2408)
@@ -54,6 +54,12 @@
         return PISA_PENDING_DONE;
     }
 
+    if ( !pisa_ipv6_addr_is_hit(&pend->key.addr.sin6_addr) ) {
+
+        PISA_DEBUG(PL_STATEMACHINE, "pisa_send_register_pend: trying to 
register at a non-HIP ipv6 address. aborting... \n");
+        return PISA_PENDING_DONE;
+    }
+
     inet_ntop(AF_INET6, &pend->key.addr.sin6_addr, buffer, sizeof(buffer));
     PISA_DEBUG(PL_REGISTER, "Sending REGISTER to %s, try %i\n", buffer, 
pend->count);
 

Modified: trunk/pisasd/sdregister.c
==============================================================================
--- trunk/pisasd/sdregister.c   Thu Dec 30 23:10:54 2010        (r2407)
+++ trunk/pisasd/sdregister.c   Thu Jan  6 18:45:38 2011        (r2408)
@@ -99,6 +99,12 @@
         /* @todo some sort of error message for the client? */
     }
 
+    if ( !pisa_ipv6_addr_is_hit(&addr->sin6_addr) ) {
+
+        PISA_ERROR("pisa_register_client: client with non-HIT ipv6 address. 
aborting... \n");
+        return;
+    }
+
     inet_ntop(AF_INET, &client_ipv4, ip_local, sizeof(ip_local));
     type = ntohs(pkt->body.reg.type);
     switch (type) {
-- 
This is the pisa developer mailing list. Please also subscribe to the main pisa 
list at:
//www.freelists.org/list/pisa

Other related posts:

  • » [pisa-src] r2408 - in trunk: pisacd/cdregister.c pisasd/sdregister.c - Hanno Wirtz