chiark
/
gitweb
/
~mdw
/
secnet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
site: Document some reentrancy hazards in comments
[secnet]
/
site.c
diff --git
a/site.c
b/site.c
index fe0e1a7f6ca14f8ab666442ad808c8c247b9cad1..11690523b066ea66a707769720e92d7f70cb6d88 100644
(file)
--- 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)
{
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) {
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)
{
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;
state_assert(st,st->state==SITE_RUN);
slog(st,LOG_STATE,"entering state RESOLVE");
st->state=SITE_RESOLVE;