projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6d04528
)
Fix gateway parsing in invitation files.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 17 Apr 2016 11:55:18 +0000
(13:55 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 17 Apr 2016 11:55:18 +0000
(13:55 +0200)
src/ifconfig.c
patch
|
blob
|
history
diff --git
a/src/ifconfig.c
b/src/ifconfig.c
index
4331f16
..
953499a
100644
(file)
--- a/
src/ifconfig.c
+++ b/
src/ifconfig.c
@@
-120,15
+120,16
@@
void ifconfig_address(FILE *out, const char *value) {
void ifconfig_route(FILE *out, const char *value) {
subnet_t subnet = {}, gateway = {};
char subnet_str[MAXNETSTR] = "", gateway_str[MAXNETSTR] = "";
void ifconfig_route(FILE *out, const char *value) {
subnet_t subnet = {}, gateway = {};
char subnet_str[MAXNETSTR] = "", gateway_str[MAXNETSTR] = "";
- const char *sep = strchr(value, ' ');
+ char *sep = strchr(value, ' ');
+ if(sep)
+ *sep++ = 0;
if(!str2net(&subnet, value) || !net2str(subnet_str, sizeof subnet_str, &subnet) || subnet.type == SUBNET_MAC) {
if(!str2net(&subnet, value) || !net2str(subnet_str, sizeof subnet_str, &subnet) || subnet.type == SUBNET_MAC) {
- fprintf(stderr, "Could not parse
Ifconfig
statement\n");
+ fprintf(stderr, "Could not parse
subnet in Route
statement\n");
return;
}
if(sep) {
return;
}
if(sep) {
- sep++;
if(!str2net(&gateway, sep) || !net2str(gateway_str, sizeof gateway_str, &gateway) || gateway.type != subnet.type) {
if(!str2net(&gateway, sep) || !net2str(gateway_str, sizeof gateway_str, &gateway) || gateway.type != subnet.type) {
- fprintf(stderr, "Could not parse
Ifconfig
statement\n");
+ fprintf(stderr, "Could not parse
gateway in Route
statement\n");
return;
}
char *slash = strchr(gateway_str, '/'); if(slash) *slash = 0;
return;
}
char *slash = strchr(gateway_str, '/'); if(slash) *slash = 0;