Changeset 5b8e4c0b86f93f09b2d876a97a578fa69483d008

Show
Ignore:
Timestamp:
11/02/07 10:32:56 (2 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1171186376 +0000
git-parent:

[6bf818a2c35c0fbdfc4f3bbf8d8a45a873198ce7]

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

Fix link-scoped IPv6 addresses

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/stream_output/sdp.c

    r02859f7 r5b8e4c0  
    3939        return NULL; 
    4040 
    41     const char *ttl = NULL; 
    4241    strcpy (buf, "IN IP* "); 
     42 
     43    if (vlc_getnameinfo (addr, addrlen, buf + 7, MAXSDPADDRESS - 7, NULL, 
     44                         NI_NUMERICHOST)) 
     45        return NULL; 
    4346 
    4447    switch (addr->sa_family) 
     
    4750        { 
    4851            if (net_SockAddrIsMulticast (addr, addrlen)) 
    49                 ttl = "/255"; // obsolete in RFC4566, dummy value 
     52                strcat (buf, "/255"); // obsolete in RFC4566, dummy value 
    5053            buf[5] = '4'; 
    5154            break; 
     
    5457#ifdef AF_INET6 
    5558        case AF_INET6: 
     59        { 
     60            char *ptr = strchr (buf, '%'); 
     61            if (ptr != NULL) 
     62                *ptr = '\0'; // remove scope ID 
    5663            buf[5] = '6'; 
    5764            break; 
     65        } 
    5866#endif 
    5967 
     
    6169            return NULL; 
    6270    } 
    63  
    64     if (vlc_getnameinfo (addr, addrlen, buf + 7, MAXSDPADDRESS - 7, NULL, 
    65                          NI_NUMERICHOST)) 
    66         return NULL; 
    67  
    68     if (ttl != NULL) 
    69         strcat (buf, ttl); 
    7071 
    7172    return buf;