|
|
|
@ -150,6 +150,12 @@ void retrieve_local_ips()
|
|
|
|
|
for (ifaddrs* p = ifap; p ; p = p->ifa_next) {
|
|
|
|
|
ifaddrs* cur = p;
|
|
|
|
|
|
|
|
|
|
// Ignore if no address for this interface.
|
|
|
|
|
// @see https://github.com/ossrs/srs/issues/1087#issuecomment-408847115
|
|
|
|
|
if (!cur->ifa_addr) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// retrieve IP address, ignore the tun0 network device, whose addr is NULL.
|
|
|
|
|
// @see: https://github.com/ossrs/srs/issues/141
|
|
|
|
|
bool ipv4 = (cur->ifa_addr->sa_family == AF_INET);
|
|
|
|
@ -164,6 +170,12 @@ void retrieve_local_ips()
|
|
|
|
|
for (ifaddrs* p = ifap; p ; p = p->ifa_next) {
|
|
|
|
|
ifaddrs* cur = p;
|
|
|
|
|
|
|
|
|
|
// Ignore if no address for this interface.
|
|
|
|
|
// @see https://github.com/ossrs/srs/issues/1087#issuecomment-408847115
|
|
|
|
|
if (!cur->ifa_addr) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// retrieve IP address, ignore the tun0 network device, whose addr is NULL.
|
|
|
|
|
// @see: https://github.com/ossrs/srs/issues/141
|
|
|
|
|
bool ipv6 = (cur->ifa_addr->sa_family == AF_INET6);
|
|
|
|
@ -179,6 +191,12 @@ void retrieve_local_ips()
|
|
|
|
|
for (ifaddrs* p = ifap; p ; p = p->ifa_next) {
|
|
|
|
|
ifaddrs* cur = p;
|
|
|
|
|
|
|
|
|
|
// Ignore if no address for this interface.
|
|
|
|
|
// @see https://github.com/ossrs/srs/issues/1087#issuecomment-408847115
|
|
|
|
|
if (!cur->ifa_addr) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// retrieve IP address, ignore the tun0 network device, whose addr is NULL.
|
|
|
|
|
// @see: https://github.com/ossrs/srs/issues/141
|
|
|
|
|
bool ipv4 = (cur->ifa_addr->sa_family == AF_INET);
|
|
|
|
|