Page MenuHomeFreeBSD

D35196.1779766656.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D35196.1779766656.diff

diff --git a/sbin/dumpon/dumpon.c b/sbin/dumpon/dumpon.c
--- a/sbin/dumpon/dumpon.c
+++ b/sbin/dumpon/dumpon.c
@@ -186,6 +186,25 @@
return (ret);
}
+static void
+check_link_status(const char *ifname)
+{
+ struct ifaddrs *ifap, *ifa;
+
+ if (getifaddrs(&ifap) != 0)
+ err(EX_OSERR, "getifaddrs");
+
+ for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
+ if (strcmp(ifname, ifa->ifa_name) != 0)
+ continue;
+ if ((ifa->ifa_flags & IFF_UP) == 0) {
+ warnx("warning: %s's link is down", ifname);
+ }
+ break;
+ }
+ freeifaddrs(ifap);
+}
+
static void
check_size(int fd, const char *fn)
{
@@ -659,6 +678,9 @@
else
error = errno;
}
+ /* Emit a warning if the user configured a downed interface. */
+ if (error == 0 && netdump)
+ check_link_status(kdap->kda_iface);
explicit_bzero(kdap->kda_encryptedkey, kdap->kda_encryptedkeysize);
free(kdap->kda_encryptedkey);
explicit_bzero(kdap, sizeof(*kdap));
@@ -669,10 +691,7 @@
* errors, especially as users don't have any great
* discoverability into which NICs support netdump.
*/
- if (error == ENXIO)
- errx(EX_OSERR, "Unable to configure netdump "
- "because the interface's link is down.");
- else if (error == ENODEV)
+ if (error == ENODEV)
errx(EX_OSERR, "Unable to configure netdump "
"because the interface driver does not yet "
"support netdump.");

File Metadata

Mime Type
text/plain
Expires
Tue, May 26, 3:37 AM (1 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28774003
Default Alt Text
D35196.1779766656.diff (1 KB)

Event Timeline