Changeset 03c971f in mainline for uspace/app/nettest3/nettest3.c


Ignore:
Timestamp:
2013-08-15T14:20:16Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bb2a5b2
Parents:
f2c19b0 (diff), 2921602 (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/app/nettest3/nettest3.c

    rf2c19b0 r03c971f  
    7878                if (rc != EOK) {
    7979                        /* Try interpreting as a host name */
    80                         rc = dnsr_name2host(argv[1], &hinfo);
     80                        rc = dnsr_name2host(argv[1], &hinfo, AF_INET);
    8181                        if (rc != EOK) {
    8282                                printf("Error resolving host '%s'.\n", argv[1]);
    8383                                return rc;
    8484                        }
    85 
    86                         addr.sin_addr.s_addr = host2uint32_t_be(hinfo->addr.ipv4);
    87                         addr.sin_family = AF_INET;
     85                       
     86                        uint16_t af = inet_addr_sockaddr_in(&hinfo->addr, &addr, NULL);
     87                        if (af != AF_INET) {
     88                                printf("Host '%s' not resolved as IPv4 address.\n", argv[1]);
     89                                return rc;
     90                        }
    8891                }
    8992                printf("result: rc=%d, family=%d, addr=%x\n", rc,
Note: See TracChangeset for help on using the changeset viewer.