Change in osmo-uecups[master]: work around bogus compiler warnings

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Apr 20 11:30:32 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-uecups/+/17885 )

Change subject: work around bogus compiler warnings
......................................................................

work around bogus compiler warnings

Change-Id: I9170e4de857c1f3e003a480b12dd16fe796ec763
---
M daemon/daemon_vty.c
M daemon/gtp_tunnel.c
M daemon/main.c
M daemon/tun_device.c
4 files changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/daemon/daemon_vty.c b/daemon/daemon_vty.c
index efd9c0f..c84c727 100644
--- a/daemon/daemon_vty.c
+++ b/daemon/daemon_vty.c
@@ -127,7 +127,7 @@
 	"Local IP address\n" "Local UDP Port\n")
 {
 	struct gtp_endpoint *ep;
-	struct addrinfo *ai;
+	struct addrinfo *ai = NULL;
 	const char *ipstr;
 	uint16_t port = GTP1U_PORT;
 
diff --git a/daemon/gtp_tunnel.c b/daemon/gtp_tunnel.c
index 0d049c7..f9075f7 100644
--- a/daemon/gtp_tunnel.c
+++ b/daemon/gtp_tunnel.c
@@ -83,6 +83,7 @@
 	return NULL;
 }
 
+#if 0
 /* find tunnel by R(x_teid), T(x_teid) + A(ddr) */
 static struct gtp_tunnel *
 _gtp_tunnel_find_rta(struct gtp_daemon *d, uint32_t rx_teid, uint32_t tx_teid,
@@ -96,6 +97,7 @@
 	}
 	return NULL;
 }
+#endif
 
 /* find tunnel by R(x_teid) + optionally local endpoint */
 struct gtp_tunnel *
diff --git a/daemon/main.c b/daemon/main.c
index 863b8b4..a408df4 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -378,7 +378,7 @@
 	const char *cmd, *user;
 	char **addl_env = NULL;
 	sigset_t oldmask;
-	int nsfd, rc;
+	int nsfd = -1, rc;
 
 	juser = json_object_get(sprog, "run_as_user");
 	jcmd = json_object_get(sprog, "command");
diff --git a/daemon/tun_device.c b/daemon/tun_device.c
index 738d492..b1bd7fc 100644
--- a/daemon/tun_device.c
+++ b/daemon/tun_device.c
@@ -205,7 +205,7 @@
 	if (name) {
 		/* if a TUN interface name was specified, put it in the structure; otherwise,
 		   the kernel will try to allocate the "next" device of the specified type */
-		strncpy(ifr.ifr_name, name, IFNAMSIZ);
+		osmo_strlcpy(ifr.ifr_name, name, IFNAMSIZ);
 	}
 
 	/* try to create the device */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-uecups/+/17885
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-uecups
Gerrit-Branch: master
Gerrit-Change-Id: I9170e4de857c1f3e003a480b12dd16fe796ec763
Gerrit-Change-Number: 17885
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200420/34988e85/attachment.htm>


More information about the gerrit-log mailing list