From ef9b71a93184579b8c7849f3117308ab82bc1b7e Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 25 Jul 2019 19:56:00 -0700 Subject: [PATCH 1/2] updates ames i/o driver to drop outbound packets if not live --- pkg/urbit/vere/ames.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/urbit/vere/ames.c b/pkg/urbit/vere/ames.c index b79902250f..d2b8df3a72 100644 --- a/pkg/urbit/vere/ames.c +++ b/pkg/urbit/vere/ames.c @@ -309,6 +309,12 @@ u3_ames_ef_send(u3_pier* pir_u, u3_noun lan, u3_noun pac) return; } + if ( c3n == sam_u->liv ) { + u3l_log("ames: not yet live, dropping outbound\r\n"); + u3z(lan); u3z(pac); + return; + } + u3_pact* pac_u = c3_calloc(sizeof(*pac_u)); if ( c3y == _ames_lane_ip(lan, &pac_u->por_s, &pac_u->pip_w) ) { From f31e60b38513558ab29c191bd722b866fb3d421e Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 25 Jul 2019 19:56:34 -0700 Subject: [PATCH 2/2] updates ames i/o driver to track galaxy state transitions and print less --- pkg/urbit/include/vere/vere.h | 1 + pkg/urbit/vere/ames.c | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pkg/urbit/include/vere/vere.h b/pkg/urbit/include/vere/vere.h index f906cf5b8f..c59c61db7b 100644 --- a/pkg/urbit/include/vere/vere.h +++ b/pkg/urbit/include/vere/vere.h @@ -337,6 +337,7 @@ c3_c* dns_c; // domain XX multiple/fallback c3_w imp_w[256]; // imperial IPs time_t imp_t[256]; // imperial IP timestamps + c3_o imp_o[256]; // imperial print status } u3_ames; /* u3_save: checkpoint control. diff --git a/pkg/urbit/vere/ames.c b/pkg/urbit/vere/ames.c index d2b8df3a72..719c840f1c 100644 --- a/pkg/urbit/vere/ames.c +++ b/pkg/urbit/vere/ames.c @@ -122,11 +122,19 @@ _ames_czar_gone(u3_pact* pac_u, time_t now) u3_pier* pir_u = u3_pier_stub(); u3_ames* sam_u = pir_u->sam_u; - u3l_log("ames: czar at %s: not found (b)\n", pac_u->dns_c); + if ( c3y == sam_u->imp_o[pac_u->imp_y] ) { + u3l_log("ames: czar at %s: not found (b)\n", pac_u->dns_c); + sam_u->imp_o[pac_u->imp_y] = c3n; + } + if ( (0 == sam_u->imp_w[pac_u->imp_y]) || - (0xffffffff == sam_u->imp_w[pac_u->imp_y]) ) { + (0xffffffff == sam_u->imp_w[pac_u->imp_y]) ) + { sam_u->imp_w[pac_u->imp_y] = 0xffffffff; - } /* else keep existing ip for 5 more minutes */ + } + + // keep existing ip for 5 more minutes + // sam_u->imp_t[pac_u->imp_y] = now; _ames_pact_free(pac_u); @@ -136,8 +144,8 @@ _ames_czar_gone(u3_pact* pac_u, time_t now) */ static void _ames_czar_cb(uv_getaddrinfo_t* adr_u, - c3_i sas_i, - struct addrinfo* aif_u) + c3_i sas_i, + struct addrinfo* aif_u) { // XX revisit u3_pier* pir_u = u3_pier_stub(); @@ -160,6 +168,7 @@ _ames_czar_cb(uv_getaddrinfo_t* adr_u, sam_u->imp_w[pac_u->imp_y] = ntohl(add_u->sin_addr.s_addr); sam_u->imp_t[pac_u->imp_y] = now; + sam_u->imp_o[pac_u->imp_y] = c3y; #if 1 if ( sam_u->imp_w[pac_u->imp_y] != old_w