Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nterm/conn.c

    ra2e3ee6 r3e6a98c5  
    3333 */
    3434
    35 #include <byteorder.h>
    3635#include <stdbool.h>
    3736#include <errno.h>
    3837#include <fibril.h>
    39 #include <inet/dnsr.h>
    4038#include <net/socket.h>
    4139#include <stdio.h>
     
    7674{
    7775        struct sockaddr_in addr;
    78         dnsr_hostinfo_t *hinfo = NULL;
    7976        int rc;
    8077        char *endptr;
     
    8481        rc = inet_pton(addr.sin_family, addr_s, (uint8_t *)&addr.sin_addr);
    8582        if (rc != EOK) {
    86                 /* Try interpreting as a host name */
    87                 rc = dnsr_name2host(addr_s, &hinfo);
    88                 if (rc != EOK) {
    89                         printf("Error resolving host '%s'.\n", addr_s);
    90                         goto error;
    91                 }
    92                
    93                 rc = inet_addr_sockaddr_in(&hinfo->addr, &addr);
    94                 if (rc != EOK) {
    95                         printf("Host '%s' not resolved as IPv4 address.\n", addr_s);
    96                         return rc;
    97                 }
     83                printf("Invalid addres %s\n", addr_s);
     84                return EINVAL;
    9885        }
    9986
     
    10188        if (*endptr != '\0') {
    10289                printf("Invalid port number %s\n", port_s);
    103                 goto error;
     90                return EINVAL;
    10491        }
    10592
     
    10895                goto error;
    10996
    110         printf("Connecting to host %s port %u\n", addr_s, ntohs(addr.sin_port));
     97        printf("Connecting to address %s port %u\n", addr_s, ntohs(addr.sin_port));
    11198
    11299        rc = connect(conn_fd, (struct sockaddr *)&addr, sizeof(addr));
Note: See TracChangeset for help on using the changeset viewer.