Changeset a35b458 in mainline for uspace/srv/net/inetsrv/sroute.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/sroute.c
r3061bc1 ra35b458 96 96 { 97 97 ip_ver_t addr_ver = inet_addr_get(addr, NULL, NULL); 98 98 99 99 inet_sroute_t *best = NULL; 100 100 uint8_t best_bits = 0; 101 102 fibril_mutex_lock(&sroute_list_lock); 103 101 102 fibril_mutex_lock(&sroute_list_lock); 103 104 104 list_foreach(sroute_list, sroute_list, inet_sroute_t, sroute) { 105 105 uint8_t dest_bits; 106 106 ip_ver_t dest_ver = inet_naddr_get(&sroute->dest, NULL, NULL, 107 107 &dest_bits); 108 108 109 109 /* Skip comparison with different address family */ 110 110 if (addr_ver != dest_ver) 111 111 continue; 112 112 113 113 /* Look for the most specific route */ 114 114 if ((best != NULL) && (best_bits >= dest_bits)) 115 115 continue; 116 116 117 117 if (inet_naddr_compare_mask(&sroute->dest, addr)) { 118 118 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_sroute_find: found candidate %p", 119 119 sroute); 120 120 121 121 best = sroute; 122 122 best_bits = dest_bits; 123 123 } 124 124 } 125 125 126 126 if (best == NULL) 127 127 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 131 131 return best; 132 132 }
Note:
See TracChangeset
for help on using the changeset viewer.