@@ -291,8 +291,12 @@ int failback_listen(void)
}
/* enable receiving of the sender credentials */
- setsockopt(sock, SOL_SOCKET, SO_PASSCRED,
- &feature_on, sizeof(feature_on));
+ retval = setsockopt(sock, SOL_SOCKET, SO_PASSCRED,
+ &feature_on, sizeof(feature_on));
+ if (retval < 0) {
+ condlog(0, "failed to enable credential passing, exit");
+ goto exit;
+ }
} else {
/* Fallback to read kernel netlink events */
@@ -330,8 +334,11 @@ int failback_listen(void)
condlog(3, "receive buffer size for socket is %u.", rcvsz);
/* enable receiving of the sender credentials */
- setsockopt(sock, SOL_SOCKET, SO_PASSCRED,
- &feature_on, sizeof(feature_on));
+ if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED,
+ &feature_on, sizeof(feature_on)) < 0) {
+ condlog(0, "error on enabling credential passing for socket");
+ exit(1);
+ }
retval = bind(sock, (struct sockaddr *) &snl,
sizeof(struct sockaddr_nl));
Found by coverity. Signed-off-by: Hannes Reinecke <hare@suse.com> --- libmultipath/uevent.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)