Ticket #3884: 0001-getaddrinfo-now-accepts-shorthand-ipv4-notation.patch

File 0001-getaddrinfo-now-accepts-shorthand-ipv4-notation.patch, 1.0 KB (added by a-star, 7 years ago)

For AF_INET inet_aton is used, inet_pton otherwise

  • src/kits/network/netresolv/irs/getaddrinfo.c

    From ae28e42c50aa9ea8325f24ea061f54bc6cb13979 Mon Sep 17 00:00:00 2001
    From: A-star-ayush <myselfthebest@yahoo.com>
    Date: Tue, 18 Apr 2017 13:21:05 +0530
    Subject: [PATCH] getaddrinfo now accepts shorthand ipv4 notation
    
    ---
     src/kits/network/netresolv/irs/getaddrinfo.c | 2 --
     1 file changed, 2 deletions(-)
    
    diff --git a/src/kits/network/netresolv/irs/getaddrinfo.c b/src/kits/network/netresolv/irs/getaddrinfo.c
    index 8c901b1..fb08db5 100644
    a b explore_numeric(const struct addrinfo *pai, const char *hostname,  
    801801        return 0;
    802802
    803803    switch (afd->a_af) {
    804 #if 0 /*X/Open spec*/
    805804    case AF_INET:
    806805        if (inet_aton(hostname, (struct in_addr *)pton) == 1) {
    807806            if (pai->ai_family == afd->a_af ||
    explore_numeric(const struct addrinfo *pai, const char *hostname,  
    822821                ERR(EAI_FAMILY);    /*xxx*/
    823822        }
    824823        break;
    825 #endif
    826824    default:
    827825        if (inet_pton(afd->a_af, hostname, pton) == 1) {
    828826            if (pai->ai_family == afd->a_af ||