diff options
author | Saurabh Mohan <saurabh.mohan@vyatta.com> | 2012-08-13 14:42:58 -0700 |
---|---|---|
committer | Saurabh Mohan <saurabh.mohan@vyatta.com> | 2012-08-13 14:42:58 -0700 |
commit | 4d28253c3273473674a578396396a449a186b68c (patch) | |
tree | 315a348fcdaafd3c0782ac65e55ce65ffc9c5abd /src | |
parent | a25954fd108a5991e51803efd27ca470e3a1cb67 (diff) | |
download | vyatta-cfg-vpn-4d28253c3273473674a578396396a449a186b68c.tar.gz vyatta-cfg-vpn-4d28253c3273473674a578396396a449a186b68c.zip |
Bugfix 8276: Vti not working on a 32-bit machine due to sign bit overload.
In a 32-bit machine the signed bit is at the 32'nd bit position.
Mark used by vti set's (0x9000-0000) that bit position.
Changed the api to use strtoul to read the data from the command line and
configure the mark.
Also, changed the vyatta-cfg-vpn package to be arch dependent since it now
has a binary that it generates.
Diffstat (limited to 'src')
-rw-r--r-- | src/cfgvti.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cfgvti.c b/src/cfgvti.c index 90dc435..d3c1dc1 100644 --- a/src/cfgvti.c +++ b/src/cfgvti.c @@ -267,7 +267,13 @@ int main (int argc, char *argv[]) } uval = htonl(tmp.s_addr); } else { - uval = htonl(atol(*argv)); + errno = 0; + uval = htonl(strtoul(*argv, 0, 0)); + if (errno) { + fprintf(stderr, + "Invalid \"mark\" %s\n", *argv); + exit(-1); + } } mark = uval; } else if (strcmp(*argv, "remote") == 0) { |