Skip to content

Commit

Permalink
Fix #1087, Ignore iface without address. 3.0.37
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Aug 5, 2018
1 parent 82699ff commit ae99131
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <srs_auto_headers.hpp>
Expand Down
18 changes: 18 additions & 0 deletions trunk/src/service/srs_service_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit ae99131

Please sign in to comment.