Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于LWIP1.4.0里面的一些小BUG #80

Closed
lloongo opened this issue Apr 12, 2013 · 2 comments
Closed

关于LWIP1.4.0里面的一些小BUG #80

lloongo opened this issue Apr 12, 2013 · 2 comments

Comments

@lloongo
Copy link

lloongo commented Apr 12, 2013


static void tcpip_init_done_callback(void *arg)  //函数中
{
#ifdef LWIP_NETIF_LINK_CALLBACK
            netif_set_link_up(ethif->netif);
#endif
}
//修正为
#if LWIP_NETIF_LINK_CALLBACK
            netif_set_link_down(ethif->netif);
#endif

按正常情况应该是先down.而后再到线程中up..还有这个预编译的宏.写法有问题.应该是


#if  (LWIP_NETIF_LINK_CALLBACK)  

#endif

//本小BUG在各个LWIP里面的API文件里面都有出现


//在线程
static void eth_rx_thread_entry(void* parameter)
{
if (status)
    netifapi_netif_set_link_up(device->netif);
else
    netifapi_netif_set_link_down(device->netif);
}
/*这两个函数应该都需要判断返回值如果返回值不为RT-EOK则需要再重新发送因为如果发送不出去的话就无法通知TCP-IP处理线程网线已经被拨除*/
//修正为
if (status)
    while(netifapi_netif_set_link_up(device->netif) != RT_EOK)
        rt-thread_deay(1);
else
    while(netifapi_netif_set_link_down(device->netif) != RT_EOK)
        rt-thread_deay(1);
@BernardXiong
Copy link
Member

Thanks, I will check them.

@BernardXiong
Copy link
Member

netif link_down/up应该没问题才是,一般启动起来后就会默认把这个接口进行up。

LWIP_NETIF_LINK_CALLBACK的问题已经修复,谢谢反馈。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants