diff --git a/README.md b/README.md index 0e100e4edd..9d45f47d4a 100755 --- a/README.md +++ b/README.md @@ -184,6 +184,7 @@ Please select according to languages: ### V3 changes +* v3.0, 2018-08-05, Fix [#1087][bug #1087], Ignore iface without address. 3.0.37 * v3.0, 2018-08-04, For [#1110][bug #1110], Support params in http callback. 3.0.36 * v3.0, 2018-08-02, Always use vhost in stream query, the unify uri. 3.0.35 * v3.0, 2018-08-02, For [#1031][bug #1031], SRS edge support douyu.com. 3.0.34 @@ -1452,6 +1453,7 @@ Winlin [bug #1057]: https://github.com/ossrs/srs/issues/1057 [bug #105]: https://github.com/ossrs/srs/issues/105 [bug #727]: https://github.com/ossrs/srs/issues/727 +[bug #1087]: https://github.com/ossrs/srs/issues/1087 [bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index a3b1486960..237cf0aa8c 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -27,7 +27,7 @@ // current release version #define VERSION_MAJOR 3 #define VERSION_MINOR 0 -#define VERSION_REVISION 36 +#define VERSION_REVISION 37 // generated by configure, only macros. #include diff --git a/trunk/src/service/srs_service_utility.cpp b/trunk/src/service/srs_service_utility.cpp index e4e62746e6..987c2eb1e9 100644 --- a/trunk/src/service/srs_service_utility.cpp +++ b/trunk/src/service/srs_service_utility.cpp @@ -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);