@@ -520,7 +520,7 @@ static int compare_match_exactness(const struct wolfsentry_route *target, const
520520 } else
521521#endif
522522 {
523- right_match_score = addr_prefix_match_size (WOLFSENTRY_ROUTE_LOCAL_ADDR (target ), WOLFSENTRY_ROUTE_LOCAL_ADDR_BITS (target ), WOLFSENTRY_ROUTE_LOCAL_ADDR (right ), WOLFSENTRY_ROUTE_LOCAL_ADDR_BITS (right ));
523+ right_match_score = addr_prefix_match_size (WOLFSENTRY_ROUTE_REMOTE_ADDR (target ), WOLFSENTRY_ROUTE_REMOTE_ADDR_BITS (target ), WOLFSENTRY_ROUTE_REMOTE_ADDR (right ), WOLFSENTRY_ROUTE_REMOTE_ADDR_BITS (right ));
524524 }
525525 }
526526
@@ -2562,8 +2562,8 @@ static wolfsentry_errcode_t wolfsentry_route_event_dispatch_0(
25622562 (WOLFSENTRY_ATOMIC_LOAD (rule_route -> meta .derogatory_count )
25632563 >= config -> config .derogatory_threshold_for_penaltybox )
25642564 :
2565- (WOLFSENTRY_ATOMIC_LOAD (rule_route -> meta .derogatory_count )
2566- - WOLFSENTRY_ATOMIC_LOAD (rule_route -> meta .commendable_count )
2565+ (( int ) WOLFSENTRY_ATOMIC_LOAD (rule_route -> meta .derogatory_count )
2566+ - ( int ) WOLFSENTRY_ATOMIC_LOAD (rule_route -> meta .commendable_count )
25672567 >= (int )config -> config .derogatory_threshold_for_penaltybox )))
25682568 {
25692569 wolfsentry_route_flags_t flags_before ;
@@ -2961,6 +2961,10 @@ static wolfsentry_errcode_t wolfsentry_route_event_dispatch_by_route_1(
29612961 WOLFSENTRY_ERROR_UNLOCK_AND_RERETURN (ret );
29622962 }
29632963
2964+ if (route -> header .parent_table == NULL ) {
2965+ ret = WOLFSENTRY_ERROR_ENCODE (INTERNAL_CHECK_FATAL );
2966+ goto out ;
2967+ }
29642968 if (route -> header .parent_table -> ent_type != WOLFSENTRY_OBJECT_TYPE_ROUTE ) {
29652969 ret = WOLFSENTRY_ERROR_ENCODE (WRONG_OBJECT );
29662970 goto out ;
@@ -3095,7 +3099,7 @@ static wolfsentry_errcode_t wolfsentry_route_stale_purge_1(
30953099 (! (route -> flags & WOLFSENTRY_ROUTE_FLAG_PENDING_DELETE )) &&
30963100 ((table -> max_purgeable_idle_time == 0 ) || (now - route -> meta .last_hit_time > table -> max_purgeable_idle_time )))
30973101 {
3098- continue ;
3102+ break ;
30993103 }
31003104 }
31013105#ifdef WOLFSENTRY_THREADSAFE
0 commit comments