diff --git a/net/devif/ipv4_input.c b/net/devif/ipv4_input.c index 82acb0544a4..033e82b97f1 100644 --- a/net/devif/ipv4_input.c +++ b/net/devif/ipv4_input.c @@ -309,10 +309,11 @@ nullreturn: * Description: * * Returned Value: - * 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. + * OK - The packet was processed (or dropped) and can be discarded. + * ERROR - Hold the packet and try again later. There is a listening + * socket but no receive in place to catch the packet yet. The + * device's d_len will be set to zero in this case as there is + * no outgoing data. * ****************************************************************************/ diff --git a/net/devif/ipv6_input.c b/net/devif/ipv6_input.c index f71e82c8833..77f60e7375a 100644 --- a/net/devif/ipv6_input.c +++ b/net/devif/ipv6_input.c @@ -238,9 +238,10 @@ static bool check_destipaddr(FAR struct net_driver_s *dev, * the IPv6 packet. * Returned Value: * 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. + * ERROR - Hold the packet and try again later. There is a listening + * socket but no receive in place to catch the packet yet. The + * device's d_len will be set to zero in this case as there is + * no outgoing data. * * If this function returns to the network driver with dev->d_len > 0, * that is an indication to the driver that there is an outgoing response diff --git a/net/pkt/pkt_input.c b/net/pkt/pkt_input.c index b585dd5432f..5deaa3c6170 100644 --- a/net/pkt/pkt_input.c +++ b/net/pkt/pkt_input.c @@ -74,9 +74,10 @@ * dev - The device driver structure containing the received packet * * Return: - * OK The packet has been processed and can be deleted - * ERROR Hold the packet and try again later. There is a listening socket - * but no recv in place to catch the packet yet. + * OK The packet has been processed and can be deleted + * 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: * Called from the interrupt level or with interrupts disabled. @@ -110,10 +111,14 @@ int pkt_input(struct net_driver_s *dev) if ((flags & PKT_NEWDATA) != 0) { /* No.. the packet was not processed now. Return ERROR so - * that the driver may retry again later. + * that the driver may retry again later. We still need to + * set d_len to zero so that the driver is aware that there + * is nothing to be sent. */ - ret = ERROR; + nwarn("WARNING: Packet not processed\n"); + //dev->d_len = 0; REVISIT + ret = ERROR; } } else diff --git a/net/udp/udp_input.c b/net/udp/udp_input.c index 9af96f94edc..e28e46b5d65 100644 --- a/net/udp/udp_input.c +++ b/net/udp/udp_input.c @@ -72,11 +72,11 @@ * iplen - Length of the IP and UDP headers * * Return: - * OK The packet has been processed and can be deleted - * ERROR Hold the packet and try again later. There is a listening socket - * but no receive in place to catch the packet yet. The device's - * d_len will be set to zero in this case as there is no outgoing - * data. + * OK - The packet has been processed and can be deleted + * ERROR - Hold the packet and try again later. There is a listening + * socket but no receive in place to catch the packet yet. The + * device's d_len will be set to zero in this case as there is + * no outgoing data. * * Assumptions: * Called from the interrupt level or with interrupts disabled.