Changeset a63ff7d in mainline for uspace/srv/net/nil/nildummy

Timestamp:
2010-11-04T22:59:44Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
60898b6
Parents:
de229f8e
Message:

Do not leak the packet on error in udp_recvfrom_message().

If we don't make it to copying the user data to the client application, do not
forget to release the packet so that it can be used for something else. Also,
pop the packet ID from the socket received queue immediately or else the queue
would become inconsitent on error.

Another approach could be to keep the packet ID in the socket received queue
until the data is successfully copied to the client (just as it was done until
now) and not release the packet in case of error (just as it was done until now,
but for all cases).

The second approach could work better for transient errors as packets would not
be dropped needlessly, but for permanent errors this would render the client
unable to receive any further data.

Rather than complicate the matter, we behave conservatively and drop the packet
whenever we can't deliver it to the client.

(No files)

Note: See TracChangeset for help on using the changeset viewer.