msghdr.c: limit IP_RECVOPTS/IP_RETOPTS output in abbrev mode
* msghdr.c (print_cmsg_ip_opts): Do not print more than max_strlen
bytes of ip options in abbrev mode.
* tests/msg_control.c (print_ip_opts): Use DEFAULT_STRLEN.
(test_sol_ip): Test IP_RETOPTS output in abbrev mode.
diff --git a/msghdr.c b/msghdr.c
index 0f9ba71..dd20326 100644
--- a/msghdr.c
+++ b/msghdr.c
@@ -134,6 +134,10 @@
for (i = 0; i < data_len; ++i) {
if (i)
tprints(", ");
+ if (abbrev(tcp) && i >= max_strlen) {
+ tprints("...");
+ break;
+ }
tprintf("0x%02x", opts[i]);
}
tprints("]");