2020-05-25 12:48 AM
I am working on STM32F407, with Ethernet chip DP83848 PHY, None Os, LwIP
I tested the source below with an example.
STM32Cube_FW_F4_V1.24.0\Projects\STM324x9I_EVAL\Applications\LwIP\LwIP_TCP_Echo_Client
Internal IP connection is good. Ex) IP : 192.168.0.200 Subnet Mask: 255.255.225.0 GateWay: 192.168.0.1
No external IP connection. Ex) IP : 119.65.244.256 PORT: 10000
I can't get out of the source below
ip4_route(const ip4_addr_t *dest)
{
struct netif *netif;
..SKIP
/* iterate through netifs */
for (netif = netif_list; netif != NULL; netif = netif->next) {
/* is the netif up, does it have a link and a valid address? */
if (netif_is_up(netif) && netif_is_link_up(netif) && !ip4_addr_isany_val(*netif_ip4_addr(netif))) {
/* network mask matches? */
if (ip4_addr_netcmp(dest, netif_ip4_addr(netif), netif_ip4_netmask(netif))) {
/* return netif on which to forward IP packet */
return netif;
}
/* gateway matches on a non broadcast interface? (i.e. peer in a point to point interface) */
if (((netif->flags & NETIF_FLAG_BROADCAST) == 0) && ip4_addr_cmp(dest, netif_ip4_gw(netif))) {
/* return netif on which to forward IP packet */
return netif;
}
}
}
.. SKIP
}
Need help