Diff between 038b0b11e1a970939c6a5dc0b561bf166c1b2448 and 559410f33aa21aa9a87ef5eb257ca6854fe3c76c

Changed Files

File Additions Deletions Status
mesh/net.c +10 -4 modified

Full Patch

diff --git a/mesh/net.c b/mesh/net.c
index 0a4d2e7..556d692 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -2690,11 +2690,17 @@ static void process_beacon(void *net_ptr, void *user_data)
 	/* We have officially *seen* this beacon now */
 	beacon_data->processed = true;
 
-	if (ivi == net->iv_index && ivu == net->iv_update && kr == local_kr)
-		return;
+	/*
+	 * Ignore the beacon if it doesn't change anything, unless we're
+	 * doing IV Recovery
+	 */
+	if (net->iv_upd_state == IV_UPD_INIT ||
+				ivi != net->iv_index || ivu != net->iv_update)
+		update_iv_ivu_state(net, ivi, ivu);
+
+	if (kr != local_kr)
+		update_kr_state(subnet, kr, beacon_data->key_id);
 
-	update_iv_ivu_state(net, ivi, ivu);
-	update_kr_state(subnet, kr, beacon_data->key_id);
 	net_key_beacon_refresh(beacon_data->key_id, net->iv_index,
 		!!(subnet->kr_phase == KEY_REFRESH_PHASE_TWO), net->iv_update);
 }