Changeset 4403 for pjproject/branches/1.x
- Timestamp:
- Feb 27, 2013 2:43:38 PM (12 years ago)
- Location:
- pjproject/branches/1.x
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x
- Property svn:mergeinfo changed
/pjproject/trunk merged: 4326-4327,4355
- Property svn:mergeinfo changed
-
pjproject/branches/1.x/pjlib/src/pj/ip_helper_generic.c
r3553 r4403 166 166 } 167 167 168 /* Done with socket */169 pj_sock_close(sock);170 171 168 /* Interface interfaces */ 172 169 ifr = (struct ifreq*) ifc.ifc_req; … … 178 175 for (i=0; i<count; ++i) { 179 176 struct ifreq *itf = &ifr[i]; 177 struct ifreq iff = *itf; 180 178 struct sockaddr *ad = &itf->ifr_addr; 181 179 … … 189 187 } 190 188 191 if ((itf->ifr_flags & IFF_UP)==0) { 189 if (ioctl(sock, SIOCGIFFLAGS, &iff) != 0) { 190 TRACE_((THIS_FILE, " ioctl(SIOCGIFFLAGS) failed: %s", 191 get_os_errmsg())); 192 continue; /* Failed to get flags, continue */ 193 } 194 195 if ((iff.ifr_flags & IFF_UP)==0) { 192 196 TRACE_((THIS_FILE, " interface is down")); 193 197 continue; /* Skip when interface is down */ … … 195 199 196 200 #if PJ_IP_HELPER_IGNORE_LOOPBACK_IF 197 if (i tf->ifr_flags & IFF_LOOPBACK) {201 if (iff.ifr_flags & IFF_LOOPBACK) { 198 202 TRACE_((THIS_FILE, " loopback interface")); 199 203 continue; /* Skip loopback interface */ … … 221 225 } 222 226 227 /* Done with socket */ 228 pj_sock_close(sock); 229 223 230 TRACE_((THIS_FILE, "done, found %d address(es)", *p_cnt)); 224 231 return (*p_cnt != 0) ? PJ_SUCCESS : PJ_ENOTFOUND; 225 232 } 233 226 234 227 235 #elif defined(PJ_HAS_NET_IF_H) && PJ_HAS_NET_IF_H != 0
Note: See TracChangeset
for help on using the changeset viewer.