From d76211dc3b4cb1c58d3ca2ab28933a488091e950 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 17 Jan 2014 17:59:12 +0100 Subject: sysmobts-mgr: Check the return value of the sendto Fixes: Coverity CID 1157379 --- src/osmo-bts-sysmo/misc/sysmobts_mgr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr.c index 2e031f3c..171f79b7 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr.c @@ -210,6 +210,7 @@ static void respond_to(struct sockaddr_in *src, struct osmo_fd *fd, static char mac_str[20] = { }; struct sockaddr_in loc_addr; + int rc; char loc_ip[INET_ADDRSTRLEN]; struct msgb *msg = msgb_alloc_headroom(512, 128, "ipa get response"); if (!msg) { @@ -242,7 +243,10 @@ static void respond_to(struct sockaddr_in *src, struct osmo_fd *fd, /* ip.access nanoBTS would reply to port==3006 */ ipaccess_prepend_header_quirk(msg, IPAC_PROTO_IPACCESS); - sendto(fd->fd, msg->data, msg->len, 0, (struct sockaddr *)src, sizeof(*src)); + rc = sendto(fd->fd, msg->data, msg->len, 0, (struct sockaddr *)src, sizeof(*src)); + if (rc != msg->len) + LOGP(DFIND, LOGL_ERROR, + "Failed to send with rc(%d) errno(%d)\n", rc, errno); } static int ipaccess_bcast(struct osmo_fd *fd, unsigned int what) -- cgit v1.2.3