Changes in uspace/srv/net/inetsrv/sroute.c [02a09ed:f023251] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/sroute.c
r02a09ed rf023251 89 89 } 90 90 91 /** Find addressobject matching address @a addr.91 /** Find static route object matching address @a addr. 92 92 * 93 93 * @param addr Address … … 95 95 inet_sroute_t *inet_sroute_find(inet_addr_t *addr) 96 96 { 97 uint16_t addr_af= inet_addr_get(addr, NULL, NULL);97 ip_ver_t addr_ver = inet_addr_get(addr, NULL, NULL); 98 98 99 99 inet_sroute_t *best = NULL; … … 102 102 fibril_mutex_lock(&sroute_list_lock); 103 103 104 list_foreach(sroute_list, link) { 105 inet_sroute_t *sroute = list_get_instance(link, 106 inet_sroute_t, sroute_list); 107 104 list_foreach(sroute_list, sroute_list, inet_sroute_t, sroute) { 108 105 uint8_t dest_bits; 109 uint16_t dest_af= inet_naddr_get(&sroute->dest, NULL, NULL,106 ip_ver_t dest_ver = inet_naddr_get(&sroute->dest, NULL, NULL, 110 107 &dest_bits); 111 108 112 109 /* Skip comparison with different address family */ 113 if (addr_ af != dest_af)110 if (addr_ver != dest_ver) 114 111 continue; 115 112 … … 147 144 fibril_mutex_lock(&sroute_list_lock); 148 145 149 list_foreach(sroute_list, link) { 150 inet_sroute_t *sroute = list_get_instance(link, 151 inet_sroute_t, sroute_list); 152 146 list_foreach(sroute_list, sroute_list, inet_sroute_t, sroute) { 153 147 if (str_cmp(sroute->name, name) == 0) { 154 148 fibril_mutex_unlock(&sroute_list_lock); … … 176 170 fibril_mutex_lock(&sroute_list_lock); 177 171 178 list_foreach(sroute_list, link) { 179 inet_sroute_t *sroute = list_get_instance(link, 180 inet_sroute_t, sroute_list); 181 172 list_foreach(sroute_list, sroute_list, inet_sroute_t, sroute) { 182 173 if (sroute->id == id) { 183 174 fibril_mutex_unlock(&sroute_list_lock); … … 207 198 208 199 i = 0; 209 list_foreach(sroute_list, link) { 210 inet_sroute_t *sroute = list_get_instance(link, 211 inet_sroute_t, sroute_list); 212 200 list_foreach(sroute_list, sroute_list, inet_sroute_t, sroute) { 213 201 id_list[i++] = sroute->id; 214 202 }
Note:
See TracChangeset
for help on using the changeset viewer.