Changeset 4c14b88 in mainline for uspace/srv/net/inetsrv/inetsrv.c


Ignore:
Timestamp:
2013-12-31T07:57:14Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b973dc
Parents:
6297465 (diff), 208b5f5 (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.
Message:

mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/inetsrv/inetsrv.c

    r6297465 r4c14b88  
    4646#include <stdlib.h>
    4747#include <sys/types.h>
    48 #include <net/socket_codes.h>
    4948#include "addrobj.h"
    5049#include "icmp.h"
     
    5554#include "inetcfg.h"
    5655#include "inetping.h"
    57 #include "inetping6.h"
    5856#include "inet_link.h"
    5957#include "reass.h"
     
    6361
    6462static inet_naddr_t solicited_node_mask = {
    65         .family = AF_INET6,
     63        .version = ip_v6,
    6664        .addr6 = {0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0xff, 0, 0, 0},
    6765        .prefix = 104
     
    6967
    7068static inet_addr_t broadcast4_all_hosts = {
    71         .family = AF_INET,
     69        .version = ip_v4,
    7270        .addr = 0xffffffff
    7371};
    7472
    7573static inet_addr_t multicast_all_nodes = {
    76         .family = AF_INET6,
     74        .version = ip_v6,
    7775        .addr6 = {0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01}
    7876};
     
    116114                return EEXIST;
    117115        }
    118        
    119         rc = loc_service_register_with_iface(SERVICE_NAME_INETPING6, &sid,
    120             INET_PORT_PING6);
    121         if (rc != EOK) {
    122                 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service (%d).", rc);
    123                 return EEXIST;
    124         }
    125        
    126         rc = inet_link_discovery_start();
    127         if (rc != EOK)
    128                 return EEXIST;
    129116       
    130117        return EOK;
     
    184171
    185172        if (dgram->iplink != 0) {
     173                /* XXX TODO - IPv6 */
    186174                log_msg(LOG_DEFAULT, LVL_DEBUG, "dgram directly to iplink %zu",
    187175                    dgram->iplink);
     
    191179                        return ENOENT;
    192180
    193                 if (dgram->src.family != AF_INET ||
    194                         dgram->dest.family != AF_INET)
     181                if (dgram->src.version != ip_v4 ||
     182                        dgram->dest.version != ip_v4)
    195183                        return EINVAL;
    196184
     
    229217
    230218        /* Take source address from the address object */
    231         if (remote->family == AF_INET && remote->addr == 0xffffffff) {
    232                 local->family = AF_INET;
     219        if (remote->version == ip_v4 && remote->addr == 0xffffffff) {
     220                /* XXX TODO - IPv6 */
     221                local->version = ip_v4;
    233222                local->addr = 0;
    234223                return EOK;
    235224        }
     225
    236226        inet_naddr_addr(&dir.aobj->naddr, local);
    237227        return EOK;
     
    454444                inetping_conn(iid, icall, arg);
    455445                break;
    456         case INET_PORT_PING6:
    457                 inetping6_conn(iid, icall, arg);
    458                 break;
    459446        default:
    460447                async_answer_0(iid, ENOTSUP);
Note: See TracChangeset for help on using the changeset viewer.