Explorar o código

Update sal_socket.c

创建sock时,默认网卡联网时才优先使用
HubretXie %!s(int64=6) %!d(string=hai) anos
pai
achega
f7e5f4cd50
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      components/net/sal_socket/src/sal_socket.c

+ 1 - 1
components/net/sal_socket/src/sal_socket.c

@@ -394,7 +394,7 @@ static int socket_init(int family, int type, int protocol, struct sal_socket **r
         return -3;
     }
 
-    if (netdev_is_up(netdv_def))
+    if (netdev_is_up(netdv_def)&&netdev_is_link_up(netdv_def))
     {
         /* check default network interface device protocol family */
         pf = (struct sal_proto_family *) netdv_def->sal_user_data;