From: Ian Jackson Date: Sat, 17 May 2014 15:31:21 +0000 (+0100) Subject: site: Document some reentrancy hazards in comments X-Git-Tag: debian/0.3.2_beta1~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=77effe1d38ae820fdb5a2e623b50f467565256cb;hp=e4cfe5379b48e36de6de4deb0832837be6d60ca3 site: Document some reentrancy hazards in comments No functional change. Signed-off-by: Ian Jackson --- New patch in v2 of the series. --- diff --git a/site.c b/site.c index fe0e1a7..1169052 100644 --- a/site.c +++ b/site.c @@ -1174,6 +1174,7 @@ static void site_resolve_callback(void *sst, struct in_addr *address) static bool_t initiate_key_setup(struct site *st, cstring_t reason, const struct comm_addr *prod_hint) { + /* Reentrancy hazard: can call enter_new_state/enter_state_* */ if (st->state!=SITE_RUN) return False; slog(st,LOG_SETUP_INIT,"initiating key exchange (%s)",reason); if (st->address) { @@ -1286,6 +1287,7 @@ static void enter_state_run(struct site *st) static bool_t enter_state_resolve(struct site *st) { + /* Reentrancy hazard! See ensure_resolving. */ state_assert(st,st->state==SITE_RUN); slog(st,LOG_STATE,"entering state RESOLVE"); st->state=SITE_RESOLVE;