bug fix to honor the fwknop client --time-offset-plus and --time-offset-minus options
authorMichael Rash <mbr@cipherdyne.org>
Wed, 23 Nov 2011 03:34:10 +0000 (22:34 -0500)
committerMichael Rash <mbr@cipherdyne.org>
Wed, 23 Nov 2011 03:34:10 +0000 (22:34 -0500)
client/fwknop.c

index 22e6ed5..687f5a0 100644 (file)
@@ -111,6 +111,27 @@ main(int argc, char **argv)
         return(EXIT_FAILURE);
     }
 
+    /* Adjust the SPA timestamp if necessary
+    */
+    if(options.time_offset_plus > 0)
+    {
+        res = fko_set_timestamp(ctx, options.time_offset_plus);
+        if(res != FKO_SUCCESS)
+        {
+            errmsg("fko_set_timestamp", res);
+            return(EXIT_FAILURE);
+        }
+    }
+    if(options.time_offset_minus > 0)
+    {
+        res = fko_set_timestamp(ctx, -options.time_offset_minus);
+        if(res != FKO_SUCCESS)
+        {
+            errmsg("fko_set_timestamp", res);
+            return(EXIT_FAILURE);
+        }
+    }
+
     if(options.server_command[0] != 0x0)
     {
         /* Set the access message to a command that the server will