diff options
| author | Bernard Xiong <[email protected]> | 2019-01-29 04:36:26 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-01-29 04:36:26 +0800 |
| commit | 7069de3a2654149d4aa8bd8ae7534d5e55e2ddb3 (patch) | |
| tree | 89af78b564dcc3c8903bb622dd6681b57e3c8455 /components | |
| parent | aa1e41d04f6b7b37786b1d88f492701e9d4acf5a (diff) | |
| parent | 32d1bfd9492c0f724585cff7d7b15e4887ad54d5 (diff) | |
Merge pull request #2282 from qiaoqidui/master
fix lwip2.1.0 port bug
Diffstat (limited to 'components')
| -rw-r--r-- | components/net/lwip-2.1.0/src/arch/sys_arch.c | 6 | ||||
| -rw-r--r-- | components/net/lwip-2.1.0/src/netif/ethernetif.c | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/components/net/lwip-2.1.0/src/arch/sys_arch.c b/components/net/lwip-2.1.0/src/arch/sys_arch.c index ee96249bec..17ebdfbacf 100644 --- a/components/net/lwip-2.1.0/src/arch/sys_arch.c +++ b/components/net/lwip-2.1.0/src/arch/sys_arch.c @@ -49,6 +49,8 @@ #include "lwip/dhcp.h" #include "lwip/inet.h" +#include "netif/etharp.h" + #include <string.h> #include <stdio.h> @@ -75,6 +77,10 @@ static err_t netif_device_init(struct netif *netif) /* copy device flags to netif flags */ netif->flags = ethif->flags; + netif->mtu = ETHERNET_MTU; + + /* set output */ + netif->output = etharp_output; return ERR_OK; } diff --git a/components/net/lwip-2.1.0/src/netif/ethernetif.c b/components/net/lwip-2.1.0/src/netif/ethernetif.c index 910d7c3470..893edcb05a 100644 --- a/components/net/lwip-2.1.0/src/netif/ethernetif.c +++ b/components/net/lwip-2.1.0/src/netif/ethernetif.c @@ -156,6 +156,9 @@ static err_t eth_netif_device_init(struct netif *netif) /* copy device flags to netif flags */ netif->flags = (ethif->flags & 0xff); netif->mtu = ETHERNET_MTU; + + /* set output */ + netif->output = etharp_output; #if LWIP_IPV6 netif->output_ip6 = ethip6_output; @@ -239,6 +242,9 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, char *name, rt_uint16 /* maximum transfer unit */ netif->mtu = ETHERNET_MTU; + /* set linkoutput */ + netif->linkoutput = ethernetif_linkoutput; + /* get hardware MAC address */ rt_device_control(&(dev->parent), NIOCTL_GADDR, netif->hwaddr); @@ -262,10 +268,6 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, char *name, rt_uint16 IP4_ADDR(&netmask, 0, 0, 0, 0); #endif netifapi_netif_add(netif, &ipaddr, &netmask, &gw, dev, eth_netif_device_init, tcpip_input); - - /* set output */ - netif->output = etharp_output; - netif->linkoutput = ethernetif_linkoutput; } return RT_EOK; |
