sd-rtnl: allow sd_rtnl_open_fd() to be used on bound sockets
This commit is contained in:
parent
9c0a72f961
commit
760f409a4a
|
@ -146,7 +146,8 @@ static int rtnl_open_fd_ap(sd_rtnl **ret, int fd, unsigned n_groups, va_list ap)
|
|||
addrlen = sizeof(rtnl->sockaddr);
|
||||
|
||||
r = bind(fd, &rtnl->sockaddr.sa, addrlen);
|
||||
if (r < 0)
|
||||
/* ignore EINVAL to allow opening an already bound socket */
|
||||
if (r < 0 && errno != EINVAL)
|
||||
return -errno;
|
||||
|
||||
r = getsockname(fd, &rtnl->sockaddr.sa, &addrlen);
|
||||
|
|
Loading…
Reference in a new issue