[hipl-commit] [trunk] Rev 3776: hipconf set puzzle all <value> works again.

  • From: Miika Komu <miika@xxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Tue, 2 Mar 2010 13:05:04 +0200

Committer: Miika Komu <miika@xxxxxx>
Date: Tue Mar 02 13:05:03 2010 +0200
Revision: 3776
Revision-id: miika@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  hipconf set puzzle all <value> works again.
  The user message header had to be built before any parameters.

Modified:
  M  lib/conf/hipconf.c

=== modified file 'lib/conf/hipconf.c'
--- lib/conf/hipconf.c  2010-02-27 13:59:35 +0000
+++ lib/conf/hipconf.c  2010-03-02 11:05:03 +0000
@@ -1797,6 +1797,9 @@
         newVal = atoi(opt[1]);
     }
 
+    /* Build a HIP message with socket option to get puzzle difficulty. */
+    HIP_IFE(hip_build_user_hdr(msg, msg_type, 0), -1);
+
     /* attach the hit into the message */
     err = hip_build_param_contents(msg, (void *) &hit, HIP_PARAM_HIT,
                                    sizeof(in6_addr_t));
@@ -1807,8 +1810,6 @@
 
     /* obtain the result for the get action */
     if (msg_type == SO_HIP_CONF_PUZZLE_GET) {
-        /* Build a HIP message with socket option to get puzzle difficulty. */
-        HIP_IFE(hip_build_user_hdr(msg, msg_type, 0), -1);
         /* Send the message to the daemon. The daemon fills the message. */
         HIP_IFE(hip_send_recv_daemon_info(msg, send_only, 0), -ECOMM);
 
@@ -1831,8 +1832,6 @@
             inet_ntop(AF_INET6, &hit, hit_s, INET6_ADDRSTRLEN);
             HIP_INFO("for peer hit: %s\n", hit_s);
         }
-    } else {
-        err = hip_build_user_hdr(msg, msg_type, 0);
     }
 
     /* attach new val for the set action */

Other related posts:

  • » [hipl-commit] [trunk] Rev 3776: hipconf set puzzle all <value> works again. - Miika Komu