Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/inetsrv/sroute.c

    r5a6cc679 ra35b458  
    9696{
    9797        ip_ver_t addr_ver = inet_addr_get(addr, NULL, NULL);
    98        
     98
    9999        inet_sroute_t *best = NULL;
    100100        uint8_t best_bits = 0;
    101        
    102         fibril_mutex_lock(&sroute_list_lock);
    103        
     101
     102        fibril_mutex_lock(&sroute_list_lock);
     103
    104104        list_foreach(sroute_list, sroute_list, inet_sroute_t, sroute) {
    105105                uint8_t dest_bits;
    106106                ip_ver_t dest_ver = inet_naddr_get(&sroute->dest, NULL, NULL,
    107107                    &dest_bits);
    108                
     108
    109109                /* Skip comparison with different address family */
    110110                if (addr_ver != dest_ver)
    111111                        continue;
    112                
     112
    113113                /* Look for the most specific route */
    114114                if ((best != NULL) && (best_bits >= dest_bits))
    115115                        continue;
    116                
     116
    117117                if (inet_naddr_compare_mask(&sroute->dest, addr)) {
    118118                        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_sroute_find: found candidate %p",
    119119                            sroute);
    120                        
     120
    121121                        best = sroute;
    122122                        best_bits = dest_bits;
    123123                }
    124124        }
    125        
     125
    126126        if (best == NULL)
    127127                log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_sroute_find: Not found");
    128        
    129         fibril_mutex_unlock(&sroute_list_lock);
    130        
     128
     129        fibril_mutex_unlock(&sroute_list_lock);
     130
    131131        return best;
    132132}
Note: See TracChangeset for help on using the changeset viewer.