projects
/
framework
/
connectivity
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dff9239
)
Report error when enabling IP forwarding
author
Marcel Holtmann
<marcel@holtmann.org>
Fri, 12 Nov 2010 22:57:37 +0000
(07:57 +0900)
committer
Marcel Holtmann
<marcel@holtmann.org>
Fri, 12 Nov 2010 22:57:37 +0000
(07:57 +0900)
src/tethering.c
patch
|
blob
|
history
diff --git
a/src/tethering.c
b/src/tethering.c
index
04f3409
..
420a3ca
100644
(file)
--- a/
src/tethering.c
+++ b/
src/tethering.c
@@
-86,11
+86,15
@@
static int enable_ip_forward(connman_bool_t enable)
{
FILE *f;
- int ip_forward = enable ? 1 : 0;
f = fopen("/proc/sys/net/ipv4/ip_forward", "r+");
+ if (f == NULL)
+ return -errno;
- fprintf(f, "%d", ip_forward);
+ if (enable == TRUE)
+ fprintf(f, "1");
+ else
+ fprintf(f, "0");
fclose(f);