mirror of
https://github.com/systemd/systemd.git
synced 2024-11-02 19:21:53 +03:00
resolve: fix CID#1237549 Unchecked return value
This commit is contained in:
parent
9593d9d9d5
commit
0c9eefb7e3
@ -386,7 +386,7 @@ int dns_scope_llmnr_membership(DnsScope *s, bool b) {
|
|||||||
* one. This is necessary on some devices, such as
|
* one. This is necessary on some devices, such as
|
||||||
* veth. */
|
* veth. */
|
||||||
if (b)
|
if (b)
|
||||||
setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreqn, sizeof(mreqn));
|
(void)setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreqn, sizeof(mreqn));
|
||||||
|
|
||||||
if (setsockopt(fd, IPPROTO_IP, b ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP, &mreqn, sizeof(mreqn)) < 0)
|
if (setsockopt(fd, IPPROTO_IP, b ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP, &mreqn, sizeof(mreqn)) < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
@ -402,7 +402,7 @@ int dns_scope_llmnr_membership(DnsScope *s, bool b) {
|
|||||||
return fd;
|
return fd;
|
||||||
|
|
||||||
if (b)
|
if (b)
|
||||||
setsockopt(fd, IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, &mreq, sizeof(mreq));
|
(void)setsockopt(fd, IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, &mreq, sizeof(mreq));
|
||||||
|
|
||||||
if (setsockopt(fd, IPPROTO_IPV6, b ? IPV6_ADD_MEMBERSHIP : IPV6_DROP_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
|
if (setsockopt(fd, IPPROTO_IPV6, b ? IPV6_ADD_MEMBERSHIP : IPV6_DROP_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
Loading…
Reference in New Issue
Block a user