pptp: use /sbin/ip

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2013-10-14 08:38:04 +02:00
parent 32dcdfd035
commit 051d9b0a6b

View File

@ -0,0 +1,36 @@
commit aa1536de73a383ca64f2bd325ec2844679a269c2
Author: Stefan Saraev <stefan@saraev.ca>
Date: Sat Oct 12 18:08:59 2013 +0300
use /sbin/ip for routing
diff --git a/routing.c b/routing.c
index ab20a03..7fb4277 100644
--- a/routing.c
+++ b/routing.c
@@ -55,7 +55,7 @@ regardless (not yet implemented).
void routing_init(char *ip) {
char buf[256];
- snprintf(buf, 255, "/bin/ip route get %s", ip);
+ snprintf(buf, 255, "/sbin/ip route get %s", ip);
FILE *p = popen(buf, "r");
fgets(buf, 255, p);
/* TODO: check for failure of fgets */
@@ -66,14 +66,14 @@ void routing_init(char *ip) {
void routing_start() {
char buf[256];
- snprintf(buf, 255, "/bin/ip route replace %s", route);
+ snprintf(buf, 255, "/sbin/ip route replace %s", route);
FILE *p = popen(buf, "r");
pclose(p);
}
void routing_end() {
char buf[256];
- snprintf(buf, 255, "/bin/ip route delete %s", route);
+ snprintf(buf, 255, "/sbin/ip route delete %s", route);
FILE *p = popen(buf, "r");
pclose(p);
}