Changes in uspace/srv/net/inetsrv/inetsrv.c [feeac0d:695b6ff] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/inetsrv.c
rfeeac0d r695b6ff 68 68 }; 69 69 70 static inet_addr_t broadcast4_all_hosts = { 71 .family = AF_INET, 72 .addr = 0xffffffff 73 }; 74 70 75 static inet_addr_t multicast_all_nodes = { 71 76 .family = AF_INET6, … … 119 124 } 120 125 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 132 126 rc = inet_link_discovery_start(); 133 127 if (rc != EOK) … … 186 180 { 187 181 inet_dir_t dir; 182 inet_link_t *ilink; 188 183 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 */ 189 204 190 205 rc = inet_find_dir(&dgram->src, &dgram->dest, dgram->tos, &dir); … … 214 229 215 230 /* 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 } 216 236 inet_naddr_addr(&dir.aobj->naddr, local); 217 237 return EOK; … … 282 302 inet_dgram_t dgram; 283 303 284 dgram.tos = IPC_GET_ARG1(*icall); 285 286 uint8_t ttl = IPC_GET_ARG2(*icall); 304 dgram.iplink = IPC_GET_ARG1(*icall); 305 dgram.tos = IPC_GET_ARG2(*icall); 306 307 uint8_t ttl = IPC_GET_ARG3(*icall); 287 308 int df = IPC_GET_ARG3(*icall); 288 309 … … 524 545 if ((addr != NULL) || 525 546 (inet_naddr_compare_mask(&solicited_node_mask, &packet->dest)) || 526 (inet_addr_compare(&multicast_all_nodes, &packet->dest))) { 547 (inet_addr_compare(&multicast_all_nodes, &packet->dest)) || 548 (inet_addr_compare(&broadcast4_all_hosts, &packet->dest))) { 527 549 /* Destined for one of the local addresses */ 528 550
Note:
See TracChangeset
for help on using the changeset viewer.