You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ifconfig] Wrong networking interface information issue. #4355
I use ifconfig command to list dual-ethernet interfaces as below, but dump information is incorrect.
msh />ifconfig
network interface device: e0 (Default)
MTU: 1500
MAC: 82 06 21 53 94 53
FLAGS: UP LINK_UP INTERNET_DOWN DHCP_ENABLE ETHARP BROADCAST IGMP
ip address: 192.168.1.199
gw address: 192.168.1.1
net mask : 255.255.255.0
dns server #0: 192.168.31.1
dns server #1: 10.1.8.12
network interface device: e1
MTU: 1500
MAC: 82 06 21 53 94 54
FLAGS: DOWN LINK_DOWN INTERNET_DOWN DHCP_ENABLE
ip address: 0.0.0.0
gw address: 0.0.0.0
net mask : 0.0.0.0
dns server #0: 0.0.0.0
dns server #1: 0.0.0.0
msh />
msh />ping 192.168.31.1
dhcp_arp_reply()
60 bytes from 192.168.31.1 icmp_seq=0 ttl=64 time=1 ms
60 bytes from 192.168.31.1 icmp_seq=1 ttl=64 time=0 ms
60 bytes from 192.168.31.1 icmp_seq=2 ttl=64 time=0 ms
60 bytes from 192.168.31.1 icmp_seq=3 ttl=64 time=0 ms
msh />
msh />ping 192.168.1.1
60 bytes from 192.168.1.1 icmp_seq=0 ttl=64 time=1 ms
60 bytes from 192.168.1.1 icmp_seq=1 ttl=64 time=0 ms
60 bytes from 192.168.1.1 icmp_seq=2 ttl=64 time=0 ms
60 bytes from 192.168.1.1 icmp_seq=3 ttl=64 time=0 ms
msh />
Thanks for your help, i think this reason is the length of name is different between lwip and rt-thread.
the length for lwip netif's name is 2, but rt-thread is 8.
Please show the origin data of 'name' parameter.
I think for the network interface device'e0', the origin data will be e00···. For the 'e1', the origin data will be e11···.
Activity
Guozhanxin commentedon Feb 22, 2021
@xiangxistu please take a look, thanks!
xiangxistu commentedon Feb 22, 2021
According to your log, your network device both are ETH device.
For ETH device, The network information will be provided by lwip protocol stack.
I think you can direct get information of lwip netif[0] and netif[1].
the possible reason:
wosayttn commentedon Feb 23, 2021
Here, bug->(rt_strncmp(netdev->name, name, RT_NAME_MAX) == 0)
Revert to previous version -> (rt_strncmp(netdev->name, name, rt_strlen(netdev->name))
it's fine on our platform.
msh />ifconfig
network interface device: e0 (Default)
MTU: 1500
MAC: 82 06 21 53 94 53
FLAGS: UP LINK_UP INTERNET_DOWN DHCP_ENABLE ETHARP BROADCAST IGMP
ip address: 192.168.1.199
gw address: 192.168.1.1
net mask : 255.255.255.0
dns server #0: 192.168.31.1
dns server #1: 10.1.8.12
network interface device: e1
MTU: 1500
MAC: 82 06 21 53 94 54
FLAGS: UP LINK_UP INTERNET_DOWN DHCP_ENABLE ETHARP BROADCAST IGMP
ip address: 192.168.31.135
gw address: 192.168.31.1
net mask : 255.255.255.0
dns server #0: 192.168.31.1
dns server #1: 10.1.8.12
xiangxistu commentedon Feb 24, 2021
Thanks for your help, i think this reason is the length of name is different between lwip and rt-thread.
the length for lwip netif's name is 2, but rt-thread is 8.
Can you help me to verify my guess?
Please show the origin data of 'name' parameter.
I think for the network interface device'e0', the origin data will be
e00···. For the 'e1', the origin data will bee11···.xiangxistu commentedon Feb 24, 2021
OK, Thanks for your help. We have find the final reason.
We will fix the bug, thanks.