Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149963940
D29957.id88061.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29957.id88061.diff
View Options
Index: tests/sys/net/routing/rtsock_print.h
===================================================================
--- tests/sys/net/routing/rtsock_print.h
+++ tests/sys/net/routing/rtsock_print.h
@@ -40,7 +40,10 @@
#define RTSOCK_ATF_REQUIRE_MSG(_rtm, _cond, _fmt, ...) do { \
if (!(_cond)) { \
printf("-- CONDITION FAILED, rtm dump --\n\n");\
- rtsock_print_message(_rtm); \
+ rtsock_print_message(_rtm); \
+ rtsock_print_table(AF_INET); \
+ rtsock_print_table(AF_INET6); \
+ printf("===================================\n");\
} \
ATF_REQUIRE_MSG(_cond, _fmt, ##__VA_ARGS__); \
} while (0);
@@ -381,4 +384,32 @@
}
}
+static void
+print_command(char *cmd)
+{
+ char line[1024];
+
+ FILE *fp = popen(cmd, "r");
+ if (fp != NULL) {
+ while (fgets(line, sizeof(line), fp) != NULL)
+ printf("%s", line);
+ pclose(fp);
+ }
+}
+
+void
+rtsock_print_table(int family)
+{
+ char cmdbuf[128];
+ char line[1024];
+ char *key = (family == AF_INET) ? "4" : "6";
+
+ snprintf(cmdbuf, sizeof(cmdbuf), "/usr/bin/netstat -%srnW", key);
+ printf("==== %s ===\n", cmdbuf);
+ print_command(cmdbuf);
+ snprintf(cmdbuf, sizeof(cmdbuf), "/usr/bin/netstat -%sonW", key);
+ printf("==== %s ===\n", cmdbuf);
+ print_command(cmdbuf);
+}
+
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 29, 10:53 AM (3 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30497492
Default Alt Text
D29957.id88061.diff (1 KB)
Attached To
Mode
D29957: Improve debugging output on routing tests failure
Attached
Detach File
Event Timeline
Log In to Comment