hleuwer / luasnmp

Lua binding to net-snmp library
http://luasnmp.luaforge.net
Other
11 stars 7 forks source link

Fix snmp_open() failing on some versions of net-snmp #5

Closed julthomas closed 3 years ago

julthomas commented 3 years ago

In nm_snmp_open(), call to snmp_open() fails on net-snmp 5.8. Turns out this is caused by the memset(session, 0, ...) call in nm_snmp_init_session().

The patch removes nm_snmp_init_session() since it was only used in nm_snmp_open() and calls snmp_sess_init() instead, which does the same but also initializes struct member sndMsgMaxSize.

I think this should fix issue hleuwer/luasnmp#1

hleuwer commented 3 years ago

Accepted pull request - but changed code locally and modified upstream to version 1.0.8. I tested with net-snmp version 5.9 on MacOS.