[pisa-src] r1683 - trunk/pisasd/sdctx.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Fri, 13 Nov 2009 12:39:40 +0100

Author: tjansen
Date: Fri Nov 13 12:39:39 2009
New Revision: 1683

Log:
Initialize the whole structure to 0 and set different values explicitly
afterwards.

Modified:
   trunk/pisasd/sdctx.c

Modified: trunk/pisasd/sdctx.c
==============================================================================
--- trunk/pisasd/sdctx.c        Fri Nov 13 12:30:59 2009        (r1682)
+++ trunk/pisasd/sdctx.c        Fri Nov 13 12:39:39 2009        (r1683)
@@ -25,6 +25,8 @@
  */
 void sdctx_init(void)
 {
+       memset(&sd_ctx, 0, sizeof(sd_ctx));
+
        sd_ctx.flag_running = false;
        sd_ctx.flag_background = false;
        sd_ctx.flag_kill_running = false;
@@ -33,15 +35,6 @@
        sd_ctx.fd_data = -1;
        sd_ctx.fd_tunnel= -1;
        sd_ctx.fd_pisaconf = -1;
-
-       sd_ctx.tunnel_device_name[0] = 0;
-
-       sd_ctx.ctrlhandlers = NULL;
-       sd_ctx.natlist = NULL;
-       sd_ctx.conlist = NULL;
-       sd_ctx.disable_ip4_forward=0;
-
-       memset(&sd_ctx.scheduler, 0, sizeof(pisa_scheduler));
 }
 
 /**

Other related posts:

  • » [pisa-src] r1683 - trunk/pisasd/sdctx.c - Thomas Jansen