]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
fixed problem with get for medians (getnext worked though, wow!)
authorkostas <>
Fri, 27 Feb 1998 07:15:14 +0000 (07:15 +0000)
committerkostas <>
Fri, 27 Feb 1998 07:15:14 +0000 (07:15 +0000)
snmplib/parse.c
src/snmp_agent.cc

index 47a5c25bb245aa0c38a7f55f60b1194a2a3de40d..dd3234b640301501ad2d763af0ec26703fa609b8 100644 (file)
@@ -1097,7 +1097,7 @@ read_mib(filename)
        return(NULL);
 
     mbuf[0]='\0';
-    while ( (p=fgets(mbuf, 256, fp)) && strncmp(mbuf, CURRENT_MIB_VERSION,
+    while ( (p=fgets(mbuf, 256, fp)) && strncmp(&mbuf[4], CURRENT_MIB_VERSION,
                strlen(CURRENT_MIB_VERSION)));
     if (!p) {
         snmplib_debug(0, "Bad MIB version or tag missing,install original!\n");
index f0de775ad10bac272f6a6c72a2b87c0fa722db15..50f60043ce98f6ee1a7dd0079693a2dd55e147c0 100644 (file)
@@ -45,6 +45,13 @@ snmp_agent_parse(snmp_request_t * rq)
     cbdataAdd(rq, MEM_NONE);
     PDU = snmp_pdu_create(0);
     Community = snmp_parse(Session, PDU, buf, len);
+    
+    if (!snmp_coexist_V2toV1(PDU)) { /* incompatibility */
+        debug(49, 3) ("snmp_agent_parse: Incompatible V2 packet.\n");
+        snmp_free_pdu(PDU);
+        snmp_agent_parse_done(0, rq);
+        return;
+    }
     rq->community = Community;
     rq->PDU = PDU;
     this_reqid = PDU->reqid;