summaryrefslogtreecommitdiff
path: root/src/nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nat.c')
-rwxr-xr-xsrc/nat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nat.c b/src/nat.c
index fb557101..681acb21 100755
--- a/src/nat.c
+++ b/src/nat.c
@@ -55,8 +55,10 @@ static int enable_ip_forward(bool enable)
if (read(f, &value, sizeof(value)) < 0)
value = 0;
- if (lseek(f, 0, SEEK_SET) < 0)
+ if (lseek(f, 0, SEEK_SET) < 0) {
+ close(f);
return -errno;
+ }
}
if (enable) {
@@ -201,7 +203,7 @@ static void cleanup_nat(gpointer data)
g_free(nat);
}
-static struct connman_notifier nat_notifier = {
+static const struct connman_notifier nat_notifier = {
.name = "nat",
.default_changed = update_default_interface,
};