[PATCH 2/3] packet_get(): propagate errors to the callers and check for them