[netstack] Update error tcpip->zx error mapping

Current version of netstack may return new error values that are not
properly mapped to zircon errors. In such cases netstack was returning
ZX_ERR_INTERNAL, which is mapped to EIO in FDIO. EIO error is not
helpful to the client and POSIX APIs are not supposed to return EIO.
Updated tcpip->zx error mapping function to add the new errors:

ErrUnknownNICID -> ZX_ERR_NOT_FOUND -> ENOENT
ErrDuplicateNICID -> ZX_ERR_INVALID_ARGS -> EINVAL
ErrBadLinkEndpoint -> ZX_ERR_INVALID_ARGS -> EINVAL
ErrAborted -> ZX_ERR_CANCELED -> EBADF
ErrNoSuchFile -> ZX_ERR_NOT_FOUND -> ENOENT
ErrInvalidOptionValue -> ZX_ERR_INVALID_ARGS -> EINVAL
ErrNoLinkAddress -> ZX_ERR_ADDRESS_UNREACHABLE -> ENETUNREACH
ErrBadAddress -> ZX_ERR_INVALID_ARGS -> EINVAL
ErrNetworkUnreachable -> ZX_ERR_ADDRESS_UNREACHABLE -> ENETUNREACH
ErrMessageTooLong  -> ZX_ERR_OUT_OF_RANGE -> EINVAL
ErrNoBufferSpace -> ZX_ERR_NO_RESOURCES -> ENOMEM

Also renamed the function mxNetError()->zxNetError() and updated the
log messsage to make it easier to discover error codes that are not
mapped properly.

This is expected to fix chromium bug crbug.com/910315: some FDIO calls
were returning EIO.

Test: debug builds of chromium don't DCHECK due to EIO returned from FDIO.

Change-Id: Idbfc472be13c63e7048a3892b3d33c5c6906df17
1 file changed