1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
ZyXEL_PMG5617GA/package/busybox/patches/056-ENHANCE_additional_traceroute_params.patch
2022-11-27 10:16:14 +00:00

52 lines
1.4 KiB
Diff

Index: busybox-1_20_1/networking/traceroute.c
===================================================================
--- busybox-1_20_1.orig/networking/traceroute.c 2015-11-10 15:50:50.536583630 +0800
+++ busybox-1_20_1/networking/traceroute.c 2015-11-10 15:51:29.209185500 +0800
@@ -994,8 +994,17 @@
bb_error_msg_and_die(bb_msg_you_must_be_root);
#endif
}
+#ifdef ZCFG_SUPPORT
+ if (op & OPT_WAITTIME){
+ if(!outputRDM)
+ waittime = xatou_range(waittime_str, 1, 24 * 60 * 60);
+ else
+ waittime = xatou_range(waittime_str, 1, 24 * 60 * 60 * 1000);
+ }
+#else
if (op & OPT_WAITTIME)
waittime = xatou_range(waittime_str, 1, 24 * 60 * 60);
+#endif
if (op & OPT_PAUSE_MS)
pausemsecs = xatou_range(pausemsecs_str, 0, 60 * 60 * 1000);
if (op & OPT_FIRST_TTL)
@@ -1042,8 +1051,13 @@
dest_lsa = xhost2sockaddr(argv[0], port);
#endif
packlen = minpacket;
+#ifdef ZCFG_SUPPORT
+ if (argv[1])
+ packlen = xatoul_range(argv[1], minpacket, 65535);
+#else
if (argv[1])
packlen = xatoul_range(argv[1], minpacket, 32 * 1024);
+#endif
/* Ensure the socket fds won't be 0, 1 or 2 */
bb_sanitize_stdio();
@@ -1298,7 +1312,14 @@
send_probe(++seq, ttl);
t2 = t1 = monotonic_us();
+#ifdef ZCFG_SUPPORT
+ if(!outputRDM)
left_ms = waittime * 1000;
+ else
+ left_ms = waittime;
+#else
+ left_ms = waittime * 1000;
+#endif
while ((read_len = wait_for_reply(from_lsa, to, &t2, &left_ms)) != 0) {
int icmp_code;