We moved away from the idea of default community in all of our snmp
tools. Let's give tcpdump the same treatment so that people don't
get the wrong idea.

OK?

martijn@

Index: print-snmp.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/print-snmp.c,v
retrieving revision 1.25
diff -u -p -r1.25 print-snmp.c
--- print-snmp.c        24 Jan 2020 22:46:37 -0000      1.25
+++ print-snmp.c        23 Oct 2021 09:54:05 -0000
@@ -342,11 +342,6 @@ struct snmp3_sm {
 };
        
 /*
- * Defaults for SNMP PDU components
- */
-#define DEF_COMMUNITY "public"
-
-/*
  * constants for ASN.1 decoding
  */
 #define OIDMUX 40
@@ -1059,11 +1054,7 @@ snmp12_print(const u_char *np, u_int len
                asn1_print(&elem);
                return;
        }
-       /* default community */
-       if (strncmp((char *)elem.data.str, DEF_COMMUNITY,
-           sizeof(DEF_COMMUNITY) - 1))
-               /* ! "public" */
-               printf("C=%.*s ", (int)elem.asnlen, elem.data.str);
+       printf("C=%.*s ", (int)elem.asnlen, elem.data.str);
        length -= count;
        np += count;
 


Reply via email to