default values for snmp protocol level stuff. Makes snmp mibtree work
again which got broken since the defaults changed back in 2021.
Reported by Matthias Pitzl (pitzl <at> genua <dot> de)
Hint to use usecommonopt and OK gerhard@
-/* $OpenBSD: snmpc.c,v 1.38 2021/10/21 08:17:34 martijn Exp $ */
+/* $OpenBSD: snmpc.c,v 1.39 2022/12/20 20:12:27 martijn Exp $ */
/*
* Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org>
argc -= optind;
argv += optind;
- if (version == SNMP_V1 || version == SNMP_V2C) {
+ if (!snmp_app->usecommonopt) {
+ /* No SNMP protocol settings */
+ } else if (version == SNMP_V1 || version == SNMP_V2C) {
if (community == NULL || community[0] == '\0')
errx(1, "No community name specified.");
} else if (version == SNMP_V3) {