@@ -138,15 +138,11 @@ static void ws_bootsrap_create_ll_address(uint8_t *ll_address, const uint8_t *ma
138
138
ll_address [8 ] ^= 2 ;
139
139
}
140
140
141
- mac_neighbor_table_entry_t * ws_bootstrap_mac_neighbor_add (struct protocol_interface_info_entry * interface , const uint8_t * src64 )
142
141
143
- {
144
- mac_neighbor_table_entry_t * neighbor = mac_neighbor_table_address_discover (mac_neighbor_info (interface ), src64 , MAC_ADDR_MODE_64_BIT );
145
- if (neighbor ) {
146
- return neighbor ;
147
- }
148
142
149
- neighbor = mac_neighbor_table_entry_allocate (mac_neighbor_info (interface ), src64 );
143
+ static mac_neighbor_table_entry_t * ws_bootstrap_mac_neighbor_allocate (struct protocol_interface_info_entry * interface , const uint8_t * src64 )
144
+ {
145
+ mac_neighbor_table_entry_t * neighbor = mac_neighbor_table_entry_allocate (mac_neighbor_info (interface ), src64 );
150
146
if (!neighbor ) {
151
147
return NULL ;
152
148
}
@@ -160,6 +156,17 @@ mac_neighbor_table_entry_t *ws_bootstrap_mac_neighbor_add(struct protocol_interf
160
156
return neighbor ;
161
157
}
162
158
159
+ mac_neighbor_table_entry_t * ws_bootstrap_mac_neighbor_add (struct protocol_interface_info_entry * interface , const uint8_t * src64 )
160
+
161
+ {
162
+ mac_neighbor_table_entry_t * neighbor = mac_neighbor_table_address_discover (mac_neighbor_info (interface ), src64 , MAC_ADDR_MODE_64_BIT );
163
+ if (neighbor ) {
164
+ return neighbor ;
165
+ }
166
+
167
+ return ws_bootstrap_mac_neighbor_allocate (interface , src64 );
168
+ }
169
+
163
170
void ws_bootstrap_neighbor_set_stable (struct protocol_interface_info_entry * interface , const uint8_t * src64 )
164
171
{
165
172
mac_neighbor_table_entry_t * neighbor = mac_neighbor_table_address_discover (mac_neighbor_info (interface ), src64 , MAC_ADDR_MODE_64_BIT );
@@ -200,13 +207,13 @@ static void ws_bootstap_eapol_neigh_entry_allocate(struct protocol_interface_inf
200
207
if (!mac_entry ) {
201
208
return ;
202
209
}
203
- ws_bootstrap_neighbor_set_stable (interface , mac_64 );
204
210
mac_entry -> lifetime = 0xffffffff ;
205
211
mac_entry -> link_lifetime = 0xffffffff ;
206
212
ws_neighbor_class_entry_t * ws_neigh = ws_neighbor_class_entry_get (& interface -> ws_info -> neighbor_storage , mac_entry -> index );
207
213
if (!ws_neigh ) {
208
214
return ;
209
215
}
216
+
210
217
interface -> ws_info -> eapol_tx_index = mac_entry -> index ;
211
218
}
212
219
@@ -1990,6 +1997,13 @@ static void ws_bootstrap_neighbor_table_clean(struct protocol_interface_info_ent
1990
1997
// Enough neighbor entries
1991
1998
return ;
1992
1999
}
2000
+ uint32_t temp_link_min_timeout ;
2001
+ if (mac_neighbor_info (interface )-> neighbour_list_size == mac_neighbor_info (interface )-> list_total_size ) {
2002
+ temp_link_min_timeout = 1 ; //Accept 1 second time from last
2003
+ } else {
2004
+ temp_link_min_timeout = interface -> ws_info -> cfg -> timing .temp_link_min_timeout ;
2005
+ }
2006
+
1993
2007
memcpy (ll_target , ADDR_LINK_LOCAL_PREFIX , 8 );
1994
2008
1995
2009
uint32_t current_time_stamp = ns_sw_mac_read_current_timestamp (interface -> mac_api );
@@ -2002,17 +2016,14 @@ static void ws_bootstrap_neighbor_table_clean(struct protocol_interface_info_ent
2002
2016
continue ;
2003
2017
}
2004
2018
2005
- if (cur -> link_lifetime < WS_NEIGHBOUR_TEMPORARY_NEIGH_MAX_LIFETIME ) {
2006
- continue ;
2007
- }
2008
-
2009
2019
if (cur -> link_role == PRIORITY_PARENT_NEIGHBOUR ) {
2010
2020
//This is our primary parent we cannot delete
2011
2021
continue ;
2012
2022
}
2013
2023
2014
- if (cur -> nud_active || ws_neighbor -> negative_aro_send ) {
2024
+ if (cur -> nud_active ) {
2015
2025
//If NUD process is active do not trig
2026
+ // or Negative ARO is active
2016
2027
continue ;
2017
2028
}
2018
2029
@@ -2021,6 +2032,11 @@ static void ws_bootstrap_neighbor_table_clean(struct protocol_interface_info_ent
2021
2032
continue ;
2022
2033
}
2023
2034
2035
+ if (cur -> link_lifetime > WS_NEIGHBOUR_TEMPORARY_ENTRY_LIFETIME && cur -> link_lifetime <= WS_NEIGHBOUR_TEMPORARY_NEIGH_MAX_LIFETIME ) {
2036
+ //Do not permit to remove configured temp life time
2037
+ continue ;
2038
+ }
2039
+
2024
2040
if (cur -> trusted_device ) {
2025
2041
2026
2042
if (ipv6_neighbour_has_registered_by_eui64 (& interface -> ipv6_neighbour_cache , cur -> mac64 )) {
@@ -2039,7 +2055,7 @@ static void ws_bootstrap_neighbor_table_clean(struct protocol_interface_info_ent
2039
2055
2040
2056
//Read current timestamp
2041
2057
uint32_t time_from_last_unicast_shedule = ws_time_from_last_unicast_traffic (current_time_stamp , ws_neighbor );
2042
- if (time_from_last_unicast_shedule > interface -> ws_info -> cfg -> timing . temp_link_min_timeout ) {
2058
+ if (time_from_last_unicast_shedule >= temp_link_min_timeout ) {
2043
2059
//Accept only Enough Old Device
2044
2060
if (!neighbor_entry_ptr ) {
2045
2061
//Accept first compare
@@ -2134,7 +2150,7 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
2134
2150
ws_neighbor_class_entry_t * ws_neighbor = ws_neighbor_class_entry_get (& cur -> ws_info -> neighbor_storage , entry_ptr -> index );
2135
2151
etx_storage_t * etx_entry = etx_storage_entry_get (cur -> id , entry_ptr -> index );
2136
2152
2137
- if (!entry_ptr -> trusted_device || !ws_neighbor || !etx_entry || ws_neighbor -> negative_aro_send || entry_ptr -> link_lifetime < WS_NEIGHBOUR_TEMPORARY_NEIGH_MAX_LIFETIME ) {
2153
+ if (!entry_ptr -> trusted_device || !ws_neighbor || !etx_entry || entry_ptr -> link_lifetime <= WS_NEIGHBOUR_TEMPORARY_NEIGH_MAX_LIFETIME ) {
2138
2154
return false;
2139
2155
}
2140
2156
0 commit comments