Changes in uspace/srv/net/inetsrv/inetsrv.c [695b6ff:b323a3a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/inetsrv.c
r695b6ff rb323a3a 68 68 }; 69 69 70 static inet_addr_t broadcast4_all_hosts = {71 .family = AF_INET,72 .addr = 0xffffffff73 };74 75 70 static inet_addr_t multicast_all_nodes = { 76 71 .family = AF_INET6, … … 124 119 } 125 120 121 inet_sroute_t *sroute = inet_sroute_new(); 122 if (sroute == NULL) { 123 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed creating default route (%d).", rc); 124 return ENOMEM; 125 } 126 127 inet_naddr(&sroute->dest, 0, 0, 0, 0, 0); 128 inet_addr(&sroute->router, 10, 0, 2, 2); 129 sroute->name = str_dup("default"); 130 inet_sroute_add(sroute); 131 126 132 rc = inet_link_discovery_start(); 127 133 if (rc != EOK) … … 180 186 { 181 187 inet_dir_t dir; 182 inet_link_t *ilink;183 188 int rc; 184 185 if (dgram->iplink != 0) {186 log_msg(LOG_DEFAULT, LVL_DEBUG, "dgram directly to iplink %zu",187 dgram->iplink);188 /* Send packet directly to the specified IP link */189 ilink = inet_link_get_by_id(dgram->iplink);190 if (ilink == 0)191 return ENOENT;192 193 if (dgram->src.family != AF_INET ||194 dgram->dest.family != AF_INET)195 return EINVAL;196 197 return inet_link_send_dgram(ilink, dgram->src.addr,198 dgram->dest.addr, dgram, proto, ttl, df);199 }200 201 log_msg(LOG_DEFAULT, LVL_DEBUG, "dgram to be routed");202 203 /* Route packet using source/destination addresses */204 189 205 190 rc = inet_find_dir(&dgram->src, &dgram->dest, dgram->tos, &dir); … … 229 214 230 215 /* Take source address from the address object */ 231 if (remote->family == AF_INET && remote->addr == 0xffffffff) {232 local->family = AF_INET;233 local->addr = 0;234 return EOK;235 }236 216 inet_naddr_addr(&dir.aobj->naddr, local); 237 217 return EOK; … … 302 282 inet_dgram_t dgram; 303 283 304 dgram.iplink = IPC_GET_ARG1(*icall); 305 dgram.tos = IPC_GET_ARG2(*icall); 306 307 uint8_t ttl = IPC_GET_ARG3(*icall); 284 dgram.tos = IPC_GET_ARG1(*icall); 285 286 uint8_t ttl = IPC_GET_ARG2(*icall); 308 287 int df = IPC_GET_ARG3(*icall); 309 288 … … 467 446 fibril_mutex_lock(&client_list_lock); 468 447 469 list_foreach(client_list, client_list, inet_client_t, client) { 448 list_foreach(client_list, link) { 449 inet_client_t *client = list_get_instance(link, inet_client_t, 450 client_list); 451 470 452 if (client->protocol == proto) { 471 453 fibril_mutex_unlock(&client_list_lock); … … 545 527 if ((addr != NULL) || 546 528 (inet_naddr_compare_mask(&solicited_node_mask, &packet->dest)) || 547 (inet_addr_compare(&multicast_all_nodes, &packet->dest)) || 548 (inet_addr_compare(&broadcast4_all_hosts, &packet->dest))) { 529 (inet_addr_compare(&multicast_all_nodes, &packet->dest))) { 549 530 /* Destined for one of the local addresses */ 550 531
Note:
See TracChangeset
for help on using the changeset viewer.