Changeset 486

Show
Ignore:
Timestamp:
04/29/00 12:32:52 (14 years ago)
Author:
ucaccsp
Message:

- udp_get_host_addr4() will now return NULL on failure, and leave

errno set.

- Workaround failure to get host IP address when setting the RTP

CNAME (we use user@127.0.0.1 as the CNAME in this case).

Location:
common/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • common/trunk/MODS

    r485 r486  
    270270 
    271271v1.1.6  - Add udp_fd() function, to retrieve the underlying file descriptor. 
     272        - udp_get_host_addr4() will now return NULL on failure, and leave 
     273          errno set. 
     274        - Workaround failure to get host IP address when setting the RTP 
     275          CNAME (we use user@127.0.0.1 as the CNAME in this case).  
    272276 
    273277 
  • common/trunk/src/net_udp.c

    r484 r486  
    350350        } 
    351351        hent = gethostbyname(hname); 
     352        if (hent == NULL) { 
     353                debug_msg("Can't get host IP address: %s", strerror(errno)); 
     354                return NULL; 
     355        } 
    352356        assert(hent->h_addrtype == AF_INET); 
    353357        memcpy(&iaddr.s_addr, hent->h_addr, sizeof(iaddr.s_addr)); 
  • common/trunk/src/rtp.c

    r480 r486  
    823823        /* Now the hostname. Must be dotted-quad IP address. */ 
    824824        hname = udp_host_addr(s); 
     825        if (hname == NULL) { 
     826                /* If we can't get our IP address we use the loopback address... */ 
     827                /* This is horrible, but it stops the code from failing.         */ 
     828                hname = "127.0.0.1"; 
     829        } 
    825830        strncpy(cname + strlen(cname), hname, MAXCNAMELEN - strlen(cname)); 
    826831        return cname;