[PATCH BlueZ] mesh: Ignore beacons with IVU if IV already updated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When daemon receives beacon with IV=n+1, IVU=False it will                                          
start sending messages with new IV and set sequence to 0.                                           
However if daemon receives another beacon with IV=n+1, IVU=True it                                  
will go back to sending messages with old IV=n (IVU will be set to                                  
True).                                                                                              
Because sequence number has been reset those messages will be dropped                               
by replay protection and node will lose communication.                                              
                                                                                                    
Once IV is updated daemon should not go back to using the old value.                                
                                                                                                    
This patch adds beacon rejection if IV has already been updated.   

---
 mesh/net.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mesh/net.c b/mesh/net.c
index 9a56d2ee8..2f51a5ade 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -2717,6 +2717,12 @@ static void update_iv_ivu_state(struct mesh_net *net, uint32_t iv_index,
 			return;
 		}
 
+		/* Ignore beacons with IVU if IV already updated */
+		if (iv_index == net->iv_index) {
+			l_info("iv already updated");
+			return;
+		}
+
 		if (!net->iv_update) {
 			l_info("iv_upd_state = IV_UPD_UPDATING");
 			net->iv_upd_state = IV_UPD_UPDATING;
-- 
2.22.0




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux