mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-19 08:13:57 +00:00
libnetmap: reset errno in nmreq_register_decode()
The reset is necessary at the beginning of the function, because of
the errno logic in the error path (set errno to EINVAL if not set).
If errno is already set when calling the function, and the function
fails, the previous errno value will be inherited.
(cherry picked from commit ab639bb287
)
This commit is contained in:
parent
d61f959961
commit
5faf08808d
|
@ -257,6 +257,8 @@ nmreq_register_decode(const char **pifname, struct nmreq_register *r, struct nmc
|
|||
uint16_t nr_ringid;
|
||||
uint64_t nr_flags;
|
||||
|
||||
errno = 0;
|
||||
|
||||
/* fill the request */
|
||||
|
||||
p_state = P_START;
|
||||
|
|
Loading…
Reference in a new issue