Mercurial > hg > toybox
changeset 1164:9482222e51f5 draft
The recent switch from get_int_value to to atolx_range left route
broken. So here's a patch to switch it to atolx_range as well.
author | Isaac Dunham <ibid.ag@gmail.com> |
---|---|
date | Mon, 23 Dec 2013 20:58:24 -0600 |
parents | 972d4fc0c8a2 |
children | 3c438a08d1fb |
files | toys/pending/route.c |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/pending/route.c Mon Dec 23 09:36:14 2013 -0600 +++ b/toys/pending/route.c Mon Dec 23 20:58:24 2013 -0600 @@ -179,7 +179,7 @@ char *prefix = strchr(*tip, '/'); if (prefix) { unsigned long plen; - plen = get_int_value(prefix + 1, 0, 32); + plen = atolx_range(prefix + 1, 0, 32); //used to verify the netmask and route conflict. (((struct sockaddr_in *)&((rt)->rt_genmask))->sin_addr.s_addr) = htonl( ~(INVALID_ADDR >> plen)); @@ -199,7 +199,7 @@ if (!strcmp(*argv, "metric")) { argv++; TEST_ARGV(argv); - rt->rt_metric = get_int_value(*argv, 0, ULONG_MAX) + 1; + rt->rt_metric = atolx_range(*argv, 0, ULONG_MAX) + 1; argv++; } else if (!strcmp(*argv, "netmask")) { //when adding a network route, the netmask to be used. @@ -229,14 +229,14 @@ //set the TCP Maximum Segment Size for connections over this route. argv++; TEST_ARGV(argv); - rt->rt_mss = get_int_value(*argv, 64, 32768); //MSS low and max + rt->rt_mss = atolx_range(*argv, 64, 32768); //MSS low and max rt->rt_flags |= RTF_MSS; argv++; } else if (!strcmp(*argv, "window")) { //set the TCP window size for connections over this route to W bytes. argv++; TEST_ARGV(argv); - rt->rt_window = get_int_value(*argv, 128, INT_MAX); //win low + rt->rt_window = atolx_range(*argv, 128, INT_MAX); //win low rt->rt_flags |= RTF_WINDOW; argv++; } else if (!strcmp(*argv, "irtt")) { @@ -334,7 +334,7 @@ if (prefix) { *prefix = '\0'; - plen = get_int_value(prefix + 1, 0, 128); //DEFAULT_PREFIXLEN); + plen = atolx_range(prefix + 1, 0, 128); //DEFAULT_PREFIXLEN); } else plen = DEFAULT_PREFIXLEN; rt->rtmsg_flags = (plen == DEFAULT_PREFIXLEN) ? (RTF_UP | RTF_HOST) : RTF_UP; @@ -352,7 +352,7 @@ //set the metric field in the routing table. argv++; TEST_ARGV(argv); - rt->rtmsg_metric = get_int_value(*argv, 0, ULONG_MAX); + rt->rtmsg_metric = atolx_range(*argv, 0, ULONG_MAX); argv++; } else if (!strcmp(*argv, "gw")) { //route packets via a gateway.