mirror of
https://github.com/ossrs/srs.git
synced 2025-02-14 20:31:56 +00:00
fix #141, support tun0(vpn network device) ip retrieve. 0.9.179.
This commit is contained in:
parent
f0ffdcc0ae
commit
6539ce69f4
1 changed files with 2 additions and 6 deletions
|
@ -930,15 +930,11 @@ void retrieve_local_ipv4_ips()
|
|||
while (p != NULL) {
|
||||
sockaddr* addr = p->ifa_addr;
|
||||
|
||||
// retrieve ipv4 addr
|
||||
// ignore the tun0 network device,
|
||||
// which addr is NULL.
|
||||
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/141
|
||||
if (!addr) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// retrieve ipv4 addr
|
||||
if (addr->sa_family == AF_INET) {
|
||||
if (addr && addr->sa_family == AF_INET) {
|
||||
in_addr* inaddr = &((sockaddr_in*)addr)->sin_addr;
|
||||
|
||||
char buf[16];
|
||||
|
|
Loading…
Reference in a new issue