Always check that the network interface is Up before using it
This commit is contained in:
parent
37a476ebcd
commit
00a7b4b69a
|
@ -211,7 +211,7 @@ tnet_interfaces_L_t* tnet_get_interfaces()
|
|||
}
|
||||
|
||||
for(ifa = ifaddr; ifa; ifa = ifa->ifa_next){
|
||||
if(ifa->ifa_flags & IFF_LOOPBACK) {
|
||||
if((ifa->ifa_flags & IFF_LOOPBACK) || !(ifa->ifa_flags & IFF_UP)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,7 @@ tnet_interfaces_L_t* tnet_get_interfaces()
|
|||
sin = (struct sockaddr_in *)&(ifr->ifr_addr);
|
||||
// TODO: IPAddress if needed
|
||||
if(/*ioctl(fd, SIOCGIFFLAGS, &ifr) == 0*/1){
|
||||
if (!(ifr->ifr_flags & IFF_LOOPBACK)){
|
||||
if (!(ifr->ifr_flags & IFF_LOOPBACK) && (ifr->ifr_flags & IFF_UP)){
|
||||
if(/*ioctl(fd, SIOCGIFHWADDR, &ifr) == 0*/1){
|
||||
tnet_interface_t *iface = tnet_interface_create(ifr->ifr_name, ifr->ifr_hwaddr.sa_data, 6);
|
||||
tsk_list_push_back_data(ifaces, (void**)&(iface));
|
||||
|
@ -477,7 +477,7 @@ bail:
|
|||
/* == Unicast addresses == */
|
||||
for(ifa = ifaddr; ifa; ifa = ifa->ifa_next){
|
||||
// Skip loopback
|
||||
if (ifa->ifa_flags & IFF_LOOPBACK) {
|
||||
if ((ifa->ifa_flags & IFF_LOOPBACK) || !(ifa->ifa_flags & IFF_UP)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -738,7 +738,7 @@ int tnet_getbestsource(const char* destination, tnet_port_t port, tnet_socket_ty
|
|||
}
|
||||
|
||||
for(ifa = ifaddr; ifa; ifa = ifa->ifa_next){
|
||||
if (ifa->ifa_flags & IFF_LOOPBACK) {
|
||||
if ((ifa->ifa_flags & IFF_LOOPBACK) || !(ifa->ifa_flags & IFF_UP)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -436,7 +436,7 @@ int tsip_dialog_invite_process_ro(tsip_dialog_invite_t *self, const tsip_message
|
|||
if(TSIP_MESSAGE_HAS_CONTENT(message)){
|
||||
if(tsk_striequals("application/sdp", TSIP_MESSAGE_CONTENT_TYPE(message))){
|
||||
if(!(sdp_ro = tsdp_message_parse(TSIP_MESSAGE_CONTENT_DATA(message), TSIP_MESSAGE_CONTENT_DATA_LENGTH(message)))){
|
||||
TSK_DEBUG_ERROR("Failed to parse remote sdp message:\n [%s]", TSIP_MESSAGE_CONTENT_DATA(message));
|
||||
TSK_DEBUG_ERROR("Failed to parse remote sdp message:\n [%s]", (const char*)TSIP_MESSAGE_CONTENT_DATA(message));
|
||||
return -2;
|
||||
}
|
||||
// ICE processing
|
||||
|
|
Loading…
Reference in New Issue