On Fri, 12 Jul 2024 at 08:31, Neeraj Bansal <neerajbansal54...@gmail.com> wrote:
> We recompile everything and install no problem, but instead of fixing our 
> problem it caused net-snmp-5.9.3 to not be able to start. The error it gives 
> is: Bad user id, which could be a red herring. example below:
> [root@testboard: /root# /etc/init.d/S59netsnmp restart
> Stopping SNMP daemon: [OK]
> Starting SNMP daemon: Bad user id: snmp
I think it is a red herring, that error is from the -u option.

# /usr/sbin/snmpd -u blah
Bad user id: blah

I know that is not solving your main issue, but its got rid of one thing.

 - Craig



> [root@testboard: /root#
>
> So, we take our patches out and recompile and install, and it works again but 
> still has the 255 custom oid limitation.
>
> A snippet from our header file. Too big to paste it all.
>
> #define  TEMPC                1
> #define  TEMPF                2
> #define   UPTIME_STR             3
> #define   SERIALNUMBER            4
> #define   ALLOFIT               5
> #define   ROOTFSBUILD           6
> #define   KERNELBUILD      7
> #define   OSINFO            8
> ......
> #define PRODUCT_ID 250
> #define RUNSCRIPT 251
> #define TIMER1 252
> #define TIMER2 253
> #define TIMER3 254
> #define TIMER4 255
> #define TIMER5 256 <- This outpts an error because it wraps around and 0 is 
> not defined.
> #define TIMER6 257 <- This outputs TEMPC value instead of TIMER6.
> #define TIMER7 258
> #define TIMER8 259
> #define TIMER9 260
> #define TIMER10 261
>
> #define    EXAMPLETIMETICKS    3333
> #define  EXAMPLEIPADDRESS        4444
> #define   EXAMPLECOUNTER      7777
> #define  EXAMPLEGAUGE            8888
> #define  EXAMPLETRIGGERTRAP      9999
> #define  EXAMPLETRIGGERTRAP2     1000
>
> Notice the example defines above that were provided in the example C header 
> file, those magic numbers would have never worked because of the u_char 
> (8-bit) magic variable limitation.
>
> This is a code snippet from our custom mib C file.
>
> struct variable4 testboard_variables[] = {
>    {ROOTFSBUILD, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, testboard_var, 2, {7, 
> 1}},
>    {KERNELBUILD, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, testboard_var, 2, {7, 
> 2}},
>    {OSINFO, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, testboard_var, 2, {7, 3}},
>    {PRODUCT_ID, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, etestboard_var, 2, {7, 
> 4}},
>    {UPTIME_STR, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, testboard_var, 2, {5, 
> 1}},
>    {SERIALNUMBER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, testboard_var, 2, {5, 
> 2}},
>    {TEMPC, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, testboard_var, 2, {6,1}},
>    {TEMPF, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, testboard_var, 2, {6,2}},
>
> We have poured over the souce code looking for any other instance of u_char 
> magic that we may have missed, but they are only defined in the two files 
> mentioned above.
>
> We need some help with this. What else do we need to do in the 5.9 versions 
> to make the magic number not wrap around to zero after 255 and not crash when 
> we do that?
>
> Thanks,
>
> Neeraj Bansal
> _______________________________________________
> Net-snmp-coders mailing list
> Net-snmp-coders@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to