diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-10-11 10:48:00 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-10-11 10:48:00 -0600 |
commit | a20fafa332fe36d47f32d346fb0a54f1fc3271d3 (patch) | |
tree | 0b5c3e64d591b72b03f628a53c6f50a2df1ac94c /nuttx/net/uip/uip_input.c | |
parent | d474fee7d65e68d3962dea92eee3fb21fef315fc (diff) | |
download | nuttx-a20fafa332fe36d47f32d346fb0a54f1fc3271d3.tar.gz nuttx-a20fafa332fe36d47f32d346fb0a54f1fc3271d3.tar.bz2 nuttx-a20fafa332fe36d47f32d346fb0a54f1fc3271d3.zip |
Changed the meaning of the uip_*input functions. They now return success when a packet is dropped; This is needed for the ENCX24J600 driver that must make a decision to return the packet or not: It should not retain dropped packets. From Max Holtzberg
Diffstat (limited to 'nuttx/net/uip/uip_input.c')
-rw-r--r-- | nuttx/net/uip/uip_input.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/nuttx/net/uip/uip_input.c b/nuttx/net/uip/uip_input.c index 73773b0ed..3dffcf062 100644 --- a/nuttx/net/uip/uip_input.c +++ b/nuttx/net/uip/uip_input.c @@ -292,7 +292,11 @@ nullreturn: * Description: * * Returned Value: - * OK if packet could be processed, otherwise ERROR. + * OK The packet was processed (or dropped) and can be discarded. + * ERROR There is a matching connection, but could not dispatch the packet + * yet. Currently useful for UDP when a packet arrives before a recv + * call is in place. + * * * Assumptions: * @@ -431,7 +435,7 @@ int uip_input(struct uip_driver_s *dev) { nlldbg("Possible ping config packet received\n"); uip_icmpinput(dev); - goto done; + goto drop; } else #endif @@ -537,13 +541,16 @@ int uip_input(struct uip_driver_s *dev) goto drop; } - /* Return and let the caller do any actual transmission. */ + /* Return and let the caller do any pending transmission. */ return OK; + /* Drop the packet. NOTE that OK is returned meaning that the + * packet has been processed (although processed unsuccessfully). + */ + drop: dev->d_len = 0; - - return ERROR; + return OK; } #endif /* CONFIG_NET */ |