mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +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) {
|
while (p != NULL) {
|
||||||
sockaddr* addr = p->ifa_addr;
|
sockaddr* addr = p->ifa_addr;
|
||||||
|
|
||||||
|
// retrieve ipv4 addr
|
||||||
// ignore the tun0 network device,
|
// ignore the tun0 network device,
|
||||||
// which addr is NULL.
|
// which addr is NULL.
|
||||||
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/141
|
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/141
|
||||||
if (!addr) {
|
if (addr && addr->sa_family == AF_INET) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// retrieve ipv4 addr
|
|
||||||
if (addr->sa_family == AF_INET) {
|
|
||||||
in_addr* inaddr = &((sockaddr_in*)addr)->sin_addr;
|
in_addr* inaddr = &((sockaddr_in*)addr)->sin_addr;
|
||||||
|
|
||||||
char buf[16];
|
char buf[16];
|
||||||
|
|
Loading…
Reference in a new issue