Changeset 98abd40 in mainline for uspace/srv/net/inetsrv/addrobj.c
- Timestamp:
- 2013-07-06T21:57:22Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c8bb1633, cdc8a391
- Parents:
- b8e72fd1 (diff), 507c6f3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/addrobj.c
rb8e72fd1 r98abd40 42 42 #include <stdlib.h> 43 43 #include <str.h> 44 45 44 #include "addrobj.h" 46 45 #include "inetsrv.h" 47 46 #include "inet_link.h" 48 #include "inet_util.h"49 47 50 48 static inet_addrobj_t *inet_addrobj_find_by_name_locked(const char *, inet_link_t *); … … 106 104 /** Find address object matching address @a addr. 107 105 * 108 * @param addr Address 109 * @oaram find iaf_net to find network (using mask), 110 * iaf_addr to find local address (exact match) 106 * @param addr Address 107 * @oaram find iaf_net to find network (using mask), 108 * iaf_addr to find local address (exact match) 109 * 111 110 */ 112 111 inet_addrobj_t *inet_addrobj_find(inet_addr_t *addr, inet_addrobj_find_t find) 113 112 { 114 uint32_t mask; 115 116 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find(%x)", (unsigned)addr->ipv4); 117 118 fibril_mutex_lock(&addr_list_lock); 119 113 fibril_mutex_lock(&addr_list_lock); 114 120 115 list_foreach(addr_list, link) { 121 116 inet_addrobj_t *naddr = list_get_instance(link, 122 117 inet_addrobj_t, addr_list); 123 124 mask = inet_netmask(naddr->naddr.bits); 125 if ((naddr->naddr.ipv4 & mask) == (addr->ipv4 & mask)) { 118 119 if (inet_naddr_compare_mask(&naddr->naddr, addr)) { 126 120 fibril_mutex_unlock(&addr_list_lock); 127 121 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find: found %p", … … 130 124 } 131 125 } 132 126 133 127 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find: Not found"); 134 128 fibril_mutex_unlock(&addr_list_lock); 135 129 136 130 return NULL; 137 131 } … … 218 212 { 219 213 inet_addr_t lsrc_addr; 220 inet_addr_t *ldest_addr; 221 222 lsrc_addr.ipv4 = addr->naddr.ipv4; 223 ldest_addr = ldest; 224 225 return inet_link_send_dgram(addr->ilink, &lsrc_addr, ldest_addr, dgram, 214 inet_naddr_addr(&addr->naddr, &lsrc_addr); 215 216 return inet_link_send_dgram(addr->ilink, &lsrc_addr, ldest, dgram, 226 217 proto, ttl, df); 227 218 }
Note:
See TracChangeset
for help on using the changeset viewer.