Changeset 02a09ed in mainline for uspace/srv/net/inetsrv/sroute.c
- Timestamp:
- 2013-06-28T20:20:03Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1d24ad3
- Parents:
- edf0d27
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/sroute.c
redf0d27 r02a09ed 42 42 #include <stdlib.h> 43 43 #include <str.h> 44 45 44 #include "sroute.h" 46 45 #include "inetsrv.h" 47 46 #include "inet_link.h" 48 #include "inet_util.h"49 47 50 48 static FIBRIL_MUTEX_INITIALIZE(sroute_list_lock); … … 97 95 inet_sroute_t *inet_sroute_find(inet_addr_t *addr) 98 96 { 99 uint32_t addr_addr; 100 int rc = inet_addr_pack(addr, &addr_addr); 101 if (rc != EOK) 102 return NULL; 97 uint16_t addr_af = inet_addr_get(addr, NULL, NULL); 103 98 104 99 inet_sroute_t *best = NULL; … … 111 106 inet_sroute_t, sroute_list); 112 107 113 uint32_t dest_addr;114 108 uint8_t dest_bits; 115 rc = inet_naddr_pack(&sroute->dest, &dest_addr, &dest_bits); 116 if (rc != EOK) 109 uint16_t dest_af = inet_naddr_get(&sroute->dest, NULL, NULL, 110 &dest_bits); 111 112 /* Skip comparison with different address family */ 113 if (addr_af != dest_af) 117 114 continue; 118 115 … … 121 118 continue; 122 119 123 uint32_t mask = inet_netmask(dest_bits); 124 if ((dest_addr & mask) == (addr_addr & mask)) { 120 if (inet_naddr_compare_mask(&sroute->dest, addr)) { 125 121 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_sroute_find: found candidate %p", 126 122 sroute);
Note:
See TracChangeset
for help on using the changeset viewer.