61
µTasker general / Re: SNMP Traps not sending timely and/or locking up, appears to be ARP problem
« Last post by mark on August 02, 2023, 12:27:06 PM »Hi Ray
#if IP_INTERFACE_COUNT > 1 || IP_NETWORK_COUNT > 1 // {74}
#define _TCP_SOCKET_MASK_ASSIGN(uSocket) (uSocket &= (SOCKET_NUMBER_MASK))
#define _TCP_SOCKET_MASK(uSocket) (USOCKET)((uSocket) & (SOCKET_NUMBER_MASK))
#define _UDP_SOCKET_MASK_ASSIGN(uSocket) (uSocket &= (SOCKET_NUMBER_MASK))
#define _UDP_SOCKET_MASK(uSocket) (USOCKET)((uSocket) & (SOCKET_NUMBER_MASK))
#else
#define _TCP_SOCKET_MASK_ASSIGN(uSocket)
#define _TCP_SOCKET_MASK(uSocket) (uSocket)
#define _UDP_SOCKET_MASK_ASSIGN(uSocket)
#define _UDP_SOCKET_MASK(uSocket) (uSocket)
#endif
When used in a single network/single interface environment the masks become dummy.
However I see that when SNMP is used a further USER_INFO_MASK field is used (in order to control multiple SNMP managers).
My suggestion is that the use of the mask for UDP sockets (not TCP sockets) be forced with:
#if ((IP_INTERFACE_COUNT > 1) || (IP_NETWORK_COUNT > 1)) // {74}
#define _TCP_SOCKET_MASK_ASSIGN(uSocket) (uSocket &= (SOCKET_NUMBER_MASK))
#define _TCP_SOCKET_MASK(uSocket) (USOCKET)((uSocket) & (SOCKET_NUMBER_MASK))
#define _UDP_SOCKET_MASK_ASSIGN(uSocket) (uSocket &= (SOCKET_NUMBER_MASK))
#define _UDP_SOCKET_MASK(uSocket) (USOCKET)((uSocket) & (SOCKET_NUMBER_MASK))
#else
#define _TCP_SOCKET_MASK_ASSIGN(uSocket)
#define _TCP_SOCKET_MASK(uSocket) (uSocket)
#if defined SER_INFO_MASK
#define _UDP_SOCKET_MASK_ASSIGN(uSocket) (uSocket &= (SOCKET_NUMBER_MASK))
#define _UDP_SOCKET_MASK(uSocket) (USOCKET)((uSocket) & (SOCKET_NUMBER_MASK))
#else
#define _UDP_SOCKET_MASK_ASSIGN(uSocket)
#define _UDP_SOCKET_MASK(uSocket) (uSocket)
#endif
#endif
#endif
Thanks for identifying the issue - presumably I always had a mult-network environment when working with SNMP to have missed this.
Regards
Mark
#if IP_INTERFACE_COUNT > 1 || IP_NETWORK_COUNT > 1 // {74}
#define _TCP_SOCKET_MASK_ASSIGN(uSocket) (uSocket &= (SOCKET_NUMBER_MASK))
#define _TCP_SOCKET_MASK(uSocket) (USOCKET)((uSocket) & (SOCKET_NUMBER_MASK))
#define _UDP_SOCKET_MASK_ASSIGN(uSocket) (uSocket &= (SOCKET_NUMBER_MASK))
#define _UDP_SOCKET_MASK(uSocket) (USOCKET)((uSocket) & (SOCKET_NUMBER_MASK))
#else
#define _TCP_SOCKET_MASK_ASSIGN(uSocket)
#define _TCP_SOCKET_MASK(uSocket) (uSocket)
#define _UDP_SOCKET_MASK_ASSIGN(uSocket)
#define _UDP_SOCKET_MASK(uSocket) (uSocket)
#endif
When used in a single network/single interface environment the masks become dummy.
However I see that when SNMP is used a further USER_INFO_MASK field is used (in order to control multiple SNMP managers).
My suggestion is that the use of the mask for UDP sockets (not TCP sockets) be forced with:
#if ((IP_INTERFACE_COUNT > 1) || (IP_NETWORK_COUNT > 1)) // {74}
#define _TCP_SOCKET_MASK_ASSIGN(uSocket) (uSocket &= (SOCKET_NUMBER_MASK))
#define _TCP_SOCKET_MASK(uSocket) (USOCKET)((uSocket) & (SOCKET_NUMBER_MASK))
#define _UDP_SOCKET_MASK_ASSIGN(uSocket) (uSocket &= (SOCKET_NUMBER_MASK))
#define _UDP_SOCKET_MASK(uSocket) (USOCKET)((uSocket) & (SOCKET_NUMBER_MASK))
#else
#define _TCP_SOCKET_MASK_ASSIGN(uSocket)
#define _TCP_SOCKET_MASK(uSocket) (uSocket)
#if defined SER_INFO_MASK
#define _UDP_SOCKET_MASK_ASSIGN(uSocket) (uSocket &= (SOCKET_NUMBER_MASK))
#define _UDP_SOCKET_MASK(uSocket) (USOCKET)((uSocket) & (SOCKET_NUMBER_MASK))
#else
#define _UDP_SOCKET_MASK_ASSIGN(uSocket)
#define _UDP_SOCKET_MASK(uSocket) (uSocket)
#endif
#endif
#endif
Thanks for identifying the issue - presumably I always had a mult-network environment when working with SNMP to have missed this.
Regards
Mark