diff options
| author | bernard.xiong <[email protected]> | 2010-03-14 12:47:44 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-03-14 12:47:44 +0000 |
| commit | b437fc5924d8038af06cec88fa0be5dbcba08412 (patch) | |
| tree | d86ff14283a25ed0c5c0daf2e0ca819d624a9d28 | |
| parent | 6740422c8461a49773f8a64bd40e343f900a7ab1 (diff) | |
discard packet when tcp_input error occurs.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@485 bbd45198-f89e-11dd-88c7-29a3b14d5316
| -rw-r--r-- | net/lwip/src/netif/ethernetif.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/lwip/src/netif/ethernetif.c b/net/lwip/src/netif/ethernetif.c index 45eb9df12b..f8d449856f 100644 --- a/net/lwip/src/netif/ethernetif.c +++ b/net/lwip/src/netif/ethernetif.c @@ -64,7 +64,11 @@ err_t eth_input(struct pbuf *p, struct netif *inp) case ETHTYPE_IP:
etharp_ip_input(inp, p);
pbuf_header(p, -((rt_int16_t)sizeof(struct eth_hdr)));
- tcpip_input(p, inp);
+ if (tcpip_input(p, inp) != ERR_OK)
+ {
+ /* discard packet */
+ pbuf_free(p);
+ }
break;
case ETHTYPE_ARP:
|
