From bb925726157f17ca571c97f2a257c8da1ec826b4 Mon Sep 17 00:00:00 2001
From: Harrold Spier <harrold.spier@gmail.com>
Date: Thu, 19 Mar 2020 09:14:47 +0100
Subject: [PATCH] The first two variable bindings in the variable binding list
 of an SNMPv2-Trap-PDU should be sysUpTime.0 and snmpTrapOID.0. So both oids
 should be extend with a ".0".

---
 src/apps/snmp/snmp_traps.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/apps/snmp/snmp_traps.c b/src/apps/snmp/snmp_traps.c
index 3f83f2df..45e4dede 100644
--- a/src/apps/snmp/snmp_traps.c
+++ b/src/apps/snmp/snmp_traps.c
@@ -356,27 +356,27 @@ snmp_send_trap_or_notification_or_inform_generic(struct snmp_msg_trap *trap_msg,
   struct snmp_varbind snmp_v2_special_varbinds[] = {
                                                      /* First varbind is used to store sysUpTime */
                                                      {
-                                                       NULL,                            /* *next */
-                                                       NULL,                            /* *prev */
-                                                       {                                /* oid */
-                                                         8,                             /* oid len */
-                                                         {1, 3, 6, 1, 2, 1, 1, 3}       /* oid for sysUpTime */
+                                                       NULL,                               /* *next */
+                                                       NULL,                               /* *prev */
+                                                       {                                   /* oid */
+                                                         9,                                /* oid len */
+                                                         {1, 3, 6, 1, 2, 1, 1, 3, 0}       /* oid for sysUpTime.0 */
                                                        },
-                                                       SNMP_ASN1_TYPE_TIMETICKS,        /* type */
-                                                       sizeof(u32_t),                   /* value_len */
-                                                       NULL                             /* value */
+                                                       SNMP_ASN1_TYPE_TIMETICKS,           /* type */
+                                                       sizeof(u32_t),                      /* value_len */
+                                                       NULL                                /* value */
                                                      },
                                                      /* Second varbind is used to store snmpTrapOID */
                                                      {
-                                                       NULL,                            /* *next */
-                                                       NULL,                            /* *prev */
-                                                       {                                /* oid */
-                                                         10,                            /* oid len */
-                                                         {1, 3, 6, 1, 6, 3, 1, 1, 4, 1} /* oid for snmpTrapOID */
+                                                       NULL,                               /* *next */
+                                                       NULL,                               /* *prev */
+                                                       {                                   /* oid */
+                                                         11,                               /* oid len */
+                                                         {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0} /* oid for snmpTrapOID.0 */
                                                        },
-                                                       SNMP_ASN1_TYPE_OBJECT_ID,        /* type */
-                                                       0,                               /* value_len */
-                                                       NULL                             /* value */
+                                                       SNMP_ASN1_TYPE_OBJECT_ID,           /* type */
+                                                       0,                                  /* value_len */
+                                                       NULL                                /* value */
                                                      }
    };
 
-- 
2.21.0

