[systemd-commits] src/timesync

Tom Gundersen tomegun at kemper.freedesktop.org
Thu Sep 18 14:38:27 PDT 2014


 src/timesync/timesyncd-manager.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 2f905e821e0342c36f5a5d3a51d53aabccc800bd
Author: Tom Gundersen <teg at jklm.no>
Date:   Thu Sep 18 23:37:07 2014 +0200

    timesyncd: check return of setting IP_TOS
    
    Fonud by Coverity. Fixes CID #1237534.

diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index a5678cc..46f8bd6 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -721,7 +721,9 @@ static int manager_listen_setup(Manager *m) {
         if (r < 0)
                 return -errno;
 
-        setsockopt(m->server_socket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
+        r = setsockopt(m->server_socket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
+        if (r < 0)
+                return -errno;
 
         return sd_event_add_io(m->event, &m->event_receive, m->server_socket, EPOLLIN, manager_receive_response, m);
 }



More information about the systemd-commits mailing list