Changeset eb43a637d79cef96542e0e7f2bf52f82fdebcaf4

Show
Ignore:
Timestamp:
05/28/08 17:49:50 (3 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1211989790 +0300
git-parent:

[0c9a964bf7b8face64b103ad99c1865f85d2bf29]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1211989686 +0300
Message:

vlc_getaddrinfo -> getaddrinfo, and set sane hints

We really do not want to apply the VLC address family "policy" here.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/stream_out/standard.c

    r5e15258 reb43a63  
    387387    { 
    388388        /* Create the SDP */ 
     389        static const struct addrinfo hints = { 
     390            .ai_family = AF_UNSPEC, 
     391            .ai_socktype = SOCK_DGRAM, 
     392            .ai_protocol = 0, 
     393            .ai_flags = AI_NUMERICHOST | AI_NUMERICSERV 
     394        }; 
    389395        char *shost = var_GetNonEmptyString (p_access, "src-addr"); 
    390396        char *dhost = var_GetNonEmptyString (p_access, "dst-addr"); 
    391397        int sport = var_GetInteger (p_access, "src-port"); 
    392398        int dport = var_GetInteger (p_access, "dst-port"); 
     399        char port[6]; 
    393400        struct sockaddr_storage src, dst; 
    394401        socklen_t srclen = 0, dstlen = 0; 
    395  
    396402        struct addrinfo *res; 
    397         if (vlc_getaddrinfo (VLC_OBJECT (p_stream), dhost, dport, NULL, &res) == 0) 
     403 
     404        snprintf (port, sizeof (port), "%d", dport); 
     405        if (getaddrinfo (dhost, port, &hints, &res) == 0) 
    398406        { 
    399407            memcpy (&dst, res->ai_addr, dstlen = res->ai_addrlen); 
    400             vlc_freeaddrinfo (res); 
    401         } 
    402  
    403         if (vlc_getaddrinfo (VLC_OBJECT (p_stream), shost, sport, NULL, &res) == 0) 
     408            freeaddrinfo (res); 
     409        } 
     410 
     411        snprintf (port, sizeof (port), "%d", sport); 
     412        if (getaddrinfo (shost, port, &hints, &res) == 0) 
    404413        { 
    405414            memcpy (&src, res->ai_addr, srclen = res->ai_addrlen); 
    406             vlc_freeaddrinfo (res); 
     415            freeaddrinfo (res); 
    407416        } 
    408417