Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/libbb/inet_common.c

    r2725 r3232  
    9898#ifdef DEBUG
    9999        bb_error_msg("rresolve: unsupported address family %d!",
    100                   s_in->sin_family);
     100                s_in->sin_family);
    101101#endif
    102102        errno = EAFNOSUPPORT;
     
    165165int FAST_FUNC INET6_resolve(const char *name, struct sockaddr_in6 *sin6)
    166166{
    167     struct addrinfo req, *ai;
     167    struct addrinfo req, *ai = NULL;
    168168    int s;
    169169
    170     memset(&req, '\0', sizeof req);
     170    memset(&req, 0, sizeof(req));
    171171    req.ai_family = AF_INET6;
    172172    s = getaddrinfo(name, NULL, &req, &ai);
    173     if (s) {
     173    if (s != 0) {
    174174        bb_error_msg("getaddrinfo: %s: %d", name, s);
    175175        return -1;
    176176    }
    177     memcpy(sin6, ai->ai_addr, sizeof(struct sockaddr_in6));
    178     freeaddrinfo(ai);
     177    memcpy(sin6, ai->ai_addr, sizeof(*sin6));
     178    if (ai)
     179        freeaddrinfo(ai);
    179180    return 0;
    180181}
     
    195196#ifdef DEBUG
    196197        bb_error_msg("rresolve: unsupported address family %d!",
    197                   sin6->sin6_family);
     198                sin6->sin6_family);
    198199#endif
    199200        errno = EAFNOSUPPORT;
     
    210211    }
    211212
    212     s = getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6),
    213                 name, sizeof(name), NULL, 0, 0);
    214     if (s) {
     213    s = getnameinfo((struct sockaddr *) sin6, sizeof(*sin6),
     214                name, sizeof(name),
     215                /*serv,servlen:*/ NULL, 0,
     216                0);
     217    if (s != 0) {
    215218        bb_error_msg("getnameinfo failed");
    216219        return NULL;
Note: See TracChangeset for help on using the changeset viewer.