[network-manager-openvpn/th/ping-bgo651657: 3/7] fixup! properties: Import the ping/ping-exit/ping-restart options from openvpn
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn/th/ping-bgo651657: 3/7] fixup! properties: Import the ping/ping-exit/ping-restart options from openvpn
- Date: Mon, 10 Aug 2015 11:18:50 +0000 (UTC)
commit 975d11557bf3334233eff72f6d66dc52626421e1
Author: Thomas Haller <thaller redhat com>
Date: Mon Aug 10 12:51:57 2015 +0200
fixup! properties: Import the ping/ping-exit/ping-restart options from openvpn
properties/import-export.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/properties/import-export.c b/properties/import-export.c
index 5d5c0f8..dc9b3e0 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -217,6 +217,21 @@ parse_port (const char *str, const char *line)
return NULL;
}
+/* returns -1 in case of error */
+static int
+parse_seconds (const char *str, const char *line)
+{
+ glong secs;
+
+ errno = 0;
+ secs = strtol (str, NULL, 10);
+ if ((errno == 0) && (secs >= 0) && (secs <= G_MAXINT))
+ return (int) secs;
+
+ g_warning ("%s: invalid number of seconds in option '%s' - must be in [0, %d]", __func__, line,
G_MAXINT);
+ return -1;
+}
+
static gboolean
parse_protocol (const char *str, const char *line, gboolean *is_tcp)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]