Page MenuHomeFreeBSD

D18025.id50540.diff
No OneTemporary

D18025.id50540.diff

Index: sbin/dumpon/dumpon.8
===================================================================
--- sbin/dumpon/dumpon.8
+++ sbin/dumpon/dumpon.8
@@ -28,7 +28,7 @@
.\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd October 26, 2018
+.Dd November 17, 2018
.Dt DUMPON 8
.Os
.Sh NAME
@@ -46,7 +46,7 @@
.Op Fl k Ar pubkey
.Op Fl Z
.Op Fl z
-.Op Fl g Ar gateway | Li default
+.Op Fl g Ar gateway
.Fl s Ar server
.Fl c Ar client
.Ar iface
@@ -141,20 +141,21 @@
client.
.It Fl g Ar gateway
Optional.
-If not specified, it is assumed that the
+If not specified, the system's default router is used.
+In this case, if a default router is not configured, it is assumed that
.Ar server
-is on the same link as the
-.Ar client .
-.Pp
+is on the same link as
+.Ar client
+and
+.Xr netdump 4
+packets will be transmitted directly to
+.Ar server .
If specified,
.Ar gateway
is the address of the first-hop router between the
.Ar client
and the
.Ar server .
-The special value
-.Dv Dq default
-indicates that the currently configured system default route should be used.
.It Fl s Ar server
The IP address of the
.Xr netdumpd 8
Index: sbin/dumpon/dumpon.c
===================================================================
--- sbin/dumpon/dumpon.c
+++ sbin/dumpon/dumpon.c
@@ -88,7 +88,7 @@
fprintf(stderr,
"usage: dumpon [-v] [-k <pubkey>] [-Zz] <device>\n"
" dumpon [-v] [-k <pubkey>] [-Zz]\n"
- " [-g <gateway>|default] -s <server> -c <client> <iface>\n"
+ " [-g <gateway>] -s <server> -c <client> <iface>\n"
" dumpon [-v] off\n"
" dumpon [-v] -l\n");
exit(EX_USAGE);
@@ -109,8 +109,6 @@
size_t sz;
int error, i, ifindex, mib[7];
- ret = NULL;
-
/* First look up the interface index. */
if (getifaddrs(&ifap) != 0)
err(EX_OSERR, "getifaddrs");
@@ -148,6 +146,7 @@
free(buf);
}
+ ret = NULL;
for (next = buf; next < buf + sz; next += rtm->rtm_msglen) {
rtm = (struct rt_msghdr *)(void *)next;
if (rtm->rtm_version != RTM_VERSION)
@@ -476,12 +475,13 @@
if (inet_aton(client, &ndconf.ndc_client) == 0)
errx(EX_USAGE, "invalid client address '%s'", client);
- if (gateway == NULL)
+ gateway = find_gateway(argv[0]);
+ if (gateway == NULL) {
+ if (verbose)
+ printf("failed to look up gateway for %s\n",
+ server);
gateway = server;
- else if (strcmp(gateway, "default") == 0 &&
- (gateway = find_gateway(argv[0])) == NULL)
- errx(EX_NOHOST,
- "failed to look up next-hop router for %s", server);
+ }
if (inet_aton(gateway, &ndconf.ndc_gateway) == 0)
errx(EX_USAGE, "invalid gateway address '%s'", gateway);

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 17, 9:47 AM (7 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31652810
Default Alt Text
D18025.id50540.diff (2 KB)

Event Timeline