aboutsummaryrefslogtreecommitdiff
path: root/networking/route.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-08 12:49:22 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-08 12:49:22 +0000
commit1385899416a4396385ad421ae1f532be7103738a (patch)
treefc4d14a910593d1235318bb36abe5e9f72d2039e /networking/route.c
parent5625415085e68ac5e150f54e685417c866620d76 (diff)
downloadbusybox-w32-1385899416a4396385ad421ae1f532be7103738a.tar.gz
busybox-w32-1385899416a4396385ad421ae1f532be7103738a.tar.bz2
busybox-w32-1385899416a4396385ad421ae1f532be7103738a.zip
attempt to regularize atoi mess.
Diffstat (limited to 'networking/route.c')
-rw-r--r--networking/route.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/networking/route.c b/networking/route.c
index 2e6e017b6..65b40fcd6 100644
--- a/networking/route.c
+++ b/networking/route.c
@@ -178,7 +178,7 @@ static void INET_setroute(int action, char **args)
178 if(prefix) { 178 if(prefix) {
179 int prefix_len; 179 int prefix_len;
180 180
181 prefix_len = bb_xgetularg10_bnd(prefix+1, 0, 32); 181 prefix_len = xatoul_range(prefix+1, 0, 32);
182 mask_in_addr(rt) = htonl( ~ (0xffffffffUL >> prefix_len)); 182 mask_in_addr(rt) = htonl( ~ (0xffffffffUL >> prefix_len));
183 *prefix = '\0'; 183 *prefix = '\0';
184#if HAVE_NEW_ADDRT 184#if HAVE_NEW_ADDRT
@@ -218,7 +218,7 @@ static void INET_setroute(int action, char **args)
218 218
219#if HAVE_NEW_ADDRT 219#if HAVE_NEW_ADDRT
220 if (k == KW_IPVx_METRIC) { 220 if (k == KW_IPVx_METRIC) {
221 rt.rt_metric = bb_xgetularg10(args_m1) + 1; 221 rt.rt_metric = xatoul(args_m1) + 1;
222 continue; 222 continue;
223 } 223 }
224#endif 224#endif
@@ -259,20 +259,20 @@ static void INET_setroute(int action, char **args)
259 259
260 if (k == KW_IPVx_MSS) { /* Check valid MSS bounds. */ 260 if (k == KW_IPVx_MSS) { /* Check valid MSS bounds. */
261 rt.rt_flags |= RTF_MSS; 261 rt.rt_flags |= RTF_MSS;
262 rt.rt_mss = bb_xgetularg10_bnd(args_m1, 64, 32768); 262 rt.rt_mss = xatoul_range(args_m1, 64, 32768);
263 continue; 263 continue;
264 } 264 }
265 265
266 if (k == KW_IPVx_WINDOW) { /* Check valid window bounds. */ 266 if (k == KW_IPVx_WINDOW) { /* Check valid window bounds. */
267 rt.rt_flags |= RTF_WINDOW; 267 rt.rt_flags |= RTF_WINDOW;
268 rt.rt_window = bb_xgetularg10_bnd(args_m1, 128, INT_MAX); 268 rt.rt_window = xatoul_range(args_m1, 128, INT_MAX);
269 continue; 269 continue;
270 } 270 }
271 271
272#ifdef RTF_IRTT 272#ifdef RTF_IRTT
273 if (k == KW_IPVx_IRTT) { 273 if (k == KW_IPVx_IRTT) {
274 rt.rt_flags |= RTF_IRTT; 274 rt.rt_flags |= RTF_IRTT;
275 rt.rt_irtt = bb_xgetularg10(args_m1); 275 rt.rt_irtt = xatoul(args_m1);
276 rt.rt_irtt *= (sysconf(_SC_CLK_TCK) / 100); /* FIXME */ 276 rt.rt_irtt *= (sysconf(_SC_CLK_TCK) / 100); /* FIXME */
277#if 0 /* FIXME: do we need to check anything of this? */ 277#if 0 /* FIXME: do we need to check anything of this? */
278 if (rt.rt_irtt < 1 || rt.rt_irtt > (120 * HZ)) { 278 if (rt.rt_irtt < 1 || rt.rt_irtt > (120 * HZ)) {
@@ -353,7 +353,7 @@ static void INET6_setroute(int action, char **args)
353 char *cp; 353 char *cp;
354 if ((cp = strchr(target, '/'))) { /* Yes... const to non is ok. */ 354 if ((cp = strchr(target, '/'))) { /* Yes... const to non is ok. */
355 *cp = 0; 355 *cp = 0;
356 prefix_len = bb_xgetularg10_bnd(cp+1, 0, 128); 356 prefix_len = xatoul_range(cp+1, 0, 128);
357 } else { 357 } else {
358 prefix_len = 128; 358 prefix_len = 128;
359 } 359 }
@@ -384,7 +384,7 @@ static void INET6_setroute(int action, char **args)
384 } 384 }
385 385
386 if (k == KW_IPVx_METRIC) { 386 if (k == KW_IPVx_METRIC) {
387 rt.rtmsg_metric = bb_xgetularg10(args_m1); 387 rt.rtmsg_metric = xatoul(args_m1);
388 continue; 388 continue;
389 } 389 }
390 390