changeset 5500:d15a1aae6583 draft

if: always log about unsupported interface types in debug
author Roy Marples <roy@marples.name>
date Wed, 07 Oct 2020 14:23:23 +0100
parents 6a2da5651841
children 5b2272a0f3c3
files src/if.c
diffstat 1 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/if.c	Wed Oct 07 14:11:47 2020 +0100
+++ b/src/if.c	Wed Oct 07 14:23:23 2020 +0100
@@ -422,11 +422,14 @@
 		}
 		break;
 	default:
-		if (if_noconf)
-			active = IF_INACTIVE;
-		if (active)
-			logwarnx("%s: unsupported interface type 0x%.2x",
-			    ifp->name, ifp->hwtype);
+		if (active) {
+			if (if_noconf)
+				active = IF_INACTIVE;
+			i = active ? LOG_WARNING : LOG_DEBUG;
+			logmessage(i, "%s: unsupported"
+			    " interface type 0x%.2x",
+			    ifp->name, ifp->hw_type);
+		}
 		break;
 	}
 
@@ -632,12 +635,14 @@
 #endif
 			default:
 				/* Don't allow unless explicit */
-				if (if_noconf)
-					active = IF_INACTIVE;
-				if (active)
-					logwarnx("%s: unsupported"
+				if (active) {
+					if (if_noconf)
+						active = IF_INACTIVE;
+					i = active ? LOG_WARNING : LOG_DEBUG;
+					logmessage(i, "%s: unsupported"
 					    " interface type 0x%.2x",
 					    ifp->name, sdl->sdl_type);
+				}
 				/* Pretend it's ethernet */
 				ifp->hwtype = ARPHRD_ETHER;
 				break;