BSP_DEFAULT_ENET_OUI: accept() never return when MAC address is changed

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

BSP_DEFAULT_ENET_OUI: accept() never return when MAC address is changed

跳至解决方案
1,369 次查看
arnogir
Senior Contributor II

Hello,

By default, the MAC adress OUI is defined with:

#define BSP_DEFAULT_ENET_OUI                { 0x00, 0x00, 0x5E, 0, 0, 0 }

then when I'm using ENET_get_mac_address, the 3 MSB Bytes are 0x00, 0x00, 0x5E, and the 3 LSB bytes are according transmitted parameter value.

So, when device is initialized with MAC address 00.00.5E.1.30.39, all work correctly.

Then, I only modify the OS code to test:

#define BSP_DEFAULT_ENET_OUI                { 0x53, 0x45, 0x52, 0, 0, 0 }

So device is initialized with the following MAC address: 53.45.52.1.30.39

Then in this case, when I call accept:

DV_Eth_TCPClientSocketID = accept(DV_Eth_TCPSocketID, &DV_Eth_TCPClientSocketAddr, &DV_Eth_TCPClientSocketAddrLen);

MQX wait a socket connexion, but even if I connect my computer software to connect on the socket, accept function never return.

I not test with other MAC address, but why this work with "pre defined MAC OUI" but not with a "specific MAC OUI"?:smileyconfused:

0 项奖励
回复
1 解答
1,054 次查看
arnogir
Senior Contributor II

Hello

I found wy not working.

In fact When I change MAC address, my computer has always in ARP cache the association {IP - MAC Address} with old MAC address.

But this association is not almways refresh.

So, when MAC address is changed, if connection was done before on the same IP with another MAC address, we must clear the ARP cache.

So in dos cmd (administrator) enter following commande:

"arp -d"

Then enjoy...

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,054 次查看
arnogir
Senior Contributor II

Anybody have I idea or reproduced the problem?

0 项奖励
回复
1,055 次查看
arnogir
Senior Contributor II

Hello

I found wy not working.

In fact When I change MAC address, my computer has always in ARP cache the association {IP - MAC Address} with old MAC address.

But this association is not almways refresh.

So, when MAC address is changed, if connection was done before on the same IP with another MAC address, we must clear the ARP cache.

So in dos cmd (administrator) enter following commande:

"arp -d"

Then enjoy...

0 项奖励
回复