Issue ADD and KXSTART notifications in the right order!
authormdw <mdw>
Sat, 30 Apr 2005 19:06:32 +0000 (19:06 +0000)
committermdw <mdw>
Sat, 30 Apr 2005 19:06:32 +0000 (19:06 +0000)
keyexch.c
peer.c

index 7c0217c..f010a38 100644 (file)
--- a/keyexch.c
+++ b/keyexch.c
@@ -1217,7 +1217,7 @@ int kx_init(keyexch *kx, peer *p, keyset **ks)
   kx->f = KXF_DEAD | KXF_PUBKEY;
   start(kx, time(0));
   resend(kx);
-  a_notify("KXSTART %s", p_name(kx->p));
+  /* Don't notify here: the ADD message hasn't gone out yet. */
   return (0);
 }
 
diff --git a/peer.c b/peer.c
index 1469a3a..5fdfc1b 100644 (file)
--- a/peer.c
+++ b/peer.c
@@ -346,6 +346,7 @@ peer *p_create(const char *name, struct sockaddr *sa, size_t sz)
       a_notify("ADD %s UNKNOWN", name);
       break;
   }
+  a_notify("KXSTART %s", name);                /* Couldn't tell anyone before */
   return (p);
 
 tidy_1: