]> arthur.barton.de Git - netatalk.git/commitdiff
Fix a sigsev with DDP and signal handler.
authordidg <didg>
Tue, 27 Apr 2004 22:47:32 +0000 (22:47 +0000)
committerdidg <didg>
Tue, 27 Apr 2004 22:47:32 +0000 (22:47 +0000)
etc/afpd/afp_config.c
etc/afpd/main.c
include/atalk/asp.h
libatalk/asp/asp_getsess.c

index 6d0c7e16930a19b261ed020436d4cc2481902a64..c82532955ea0b36161521e4b4b21d518ce3d79e4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_config.c,v 1.22.6.4 2004-01-25 11:52:33 bfernhomberg Exp $
+ * $Id: afp_config.c,v 1.22.6.5 2004-04-27 22:47:32 didg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -194,6 +194,8 @@ srvloc_dereg_err:
 #ifndef NO_DDP
 static void asp_cleanup(const AFPConfig *config)
 {
+    /* we need to stop tickle handler */
+    asp_stop_tickle();
     nbp_unrgstr(config->obj.Obj, config->obj.Type, config->obj.Zone,
                 &config->obj.options.ddpaddr);
 }
index 18f70eccb314aaa9e3416c2e37028b12be94e55e..a041e6b368d619124639d3bb871a546cffccdc82 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.20.4.2.2.6 2004-02-20 21:23:13 didg Exp $
+ * $Id: main.c,v 1.20.4.2.2.7 2004-04-27 22:47:32 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -116,6 +116,9 @@ static void afp_goaway(int sig)
                 if (config->server_cleanup)
                     config->server_cleanup(config);
 
+            /* configfree close atp socket used for DDP tickle, there's an issue
+             * with atp tid.
+            */
             configfree(configs, NULL);
             if (!(configs = configinit(&default_options))) {
                 LOG(log_error, logtype_afpd, "config re-read: no servers configured");
index d147deb15b11c9e17164a6734438b80982c5ddc3..d1a8b110d4d860101436c9a2faa94dd0d4e8c939 100644 (file)
@@ -99,5 +99,6 @@ extern int asp_wrtcont      __P((ASP, char *, int *));
 #define asp_wrtreply(a,b)   asp_cmdreply((a), (b))
 extern void asp_kill        __P((int));
 extern int asp_tickle      __P((ASP, const u_int8_t, struct sockaddr_at *));
+extern void asp_stop_tickle __P((void));
 
 #endif
index 30ab837582f1094e2b32a9f80e7dc5a9495de6ed..331d32570be62f5c8bb85e6589e9d1bf037fa6b3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: asp_getsess.c,v 1.7.8.2 2003-11-13 15:39:02 didg Exp $
+ * $Id: asp_getsess.c,v 1.7.8.3 2004-04-27 22:47:32 didg Exp $
  *
  * Copyright (c) 1990,1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -99,6 +99,14 @@ void asp_kill(int sig)
     server_child_kill(children, CHILD_ASPFORK, sig);
 }
 
+void asp_stop_tickle(void)
+{
+    if (server_asp && server_asp->inited) {
+       static const struct itimerval timer = {{0, 0}, {0, 0}};
+       
+       setitimer(ITIMER_REAL, &timer, NULL);
+    }
+}
 
 /*
  * This call handles open, tickle, and getstatus requests. On a
@@ -125,7 +133,8 @@ ASP asp_getsession(ASP asp, server_child *server_children,
       if (!(children = server_children))
        return NULL;
 
-      if ((asp_ac = (struct asp_child **) 
+      /* only calloc once */
+      if (!asp_ac && (asp_ac = (struct asp_child **) 
           calloc(server_children->nsessions, sizeof(struct asp_child *)))
           == NULL)
        return NULL;
@@ -151,6 +160,7 @@ ASP asp_getsession(ASP asp, server_child *server_children,
       if ((sigaction(SIGALRM, &action, NULL) < 0) ||
          (setitimer(ITIMER_REAL, &timer, NULL) < 0)) {
        free(asp_ac);
+       server_asp = asp_ac = NULL;
        return NULL;
       }