Hi Bart,

Thank you.  I  will verify. Does the patch works for IPv6 too?

Regards,
Pushpa. T



On Tue, Oct 30, 2018 at 4:27 AM Bart Van Assche <bvanass...@acm.org> wrote:

> On Mon, 2018-10-29 at 09:52 +0530, Pushpa Thimmaiah wrote:
>
> Hi All,
> I am using option 'clientAddr'  with IPv6 address and noticed that it is
> not working.
> so I applied patch
> https://sourceforge.net/p/net-snmp/mailman/message/33064273/ on 5.7.3 but
> It seems not working.
> Kindly let me know if I am missing any configurations.
>
> Eg:
> linux machine has ipv6 '2002::2054' and sends trap using
> 'clientAddr=2002::2056'
> There is no IPv6 '2002::2056' and trap sent out via '2002::2054'.  I have
> expected it to fail when it doesnot find 2002::2056.
>
> *snmp trap sender:*
> /home/# /tmp/snmptrap -Dall -v 3 *--clientAddr="2002::2056"* -n "" -u
> testigmv6 -l authNoPriv -a MD5 -A mypassword -e 0x80001f880300b0a
> e123548  udp6:[2002::2045]:162 "" .1.3.6.1.4.1.8072.2.3.1
> .1.3.6.1.4.1.8072.2.1.1 i 444
> /home#
>
> *Trap Receiver shows:*
> usm: USM processing begun...
> usm: match on user testigmv6
> usm: Verification succeeded.
> usm: USM processing completed.
> 2018-10-29 09:43:59 UDP/IPv6: [2002::2054]:50455 [UDP/IPv6: [*2002::2054*
> ]:50455]:
> DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (89119) 0:14:51.19
> SNMPv2-MIB::snmpTrapOID.0 = OID:
> NET-SNMP-EXAMPLES-MIB::netSnmpExampleNotification
> NET-SNMP-EXAMPLES-MIB::netSnmpExampleInteger = INTEGER: 444
>
>
> Please retest with the Net-SNMP master branch. That branch includes the
> patch shown below.
>
> $ git branch --contains cc45578c2fa0b94f776
>
> * master
>
> $ git show cc45578c2fa0b94f776
>
> commit cc45578c2fa0b94f7762057ee3b8a0b795c497ff
>
> Author: Bill Fenner <fen...@gmail.com>
>
> Date:   Sun May 6 13:05:55 2018 +0000
>
>
>     snmpd: BUG: 2864: use clientaddr properly
>
>         The code parsed out the address from the clientaddr spec,
>
>     then used the return value wrong and only respected it
>
>     if it existed but didn't parse properly.
>
>
> diff --git a/snmplib/transports/snmpUDPIPv4BaseDomain.c 
> b/snmplib/transports/snmpUDPIPv4BaseDomain.c
>
> index 37d8e33b47c7..433eb809bb91 100644
>
> --- a/snmplib/transports/snmpUDPIPv4BaseDomain.c
>
> +++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c
>
> @@ -367,7 +367,7 @@ netsnmp_udpipv4base_transport(const struct sockaddr_in 
> *addr, int local)
>
>              rc = netsnmp_sockaddr_in2(&client_addr, client_socket, NULL);
>
>              if (client_address != client_socket)
>
>                  free(client_address);
>
> -            if(!rc) {
>
> +            if(rc) {
>
>                  if (!uses_port || !have_port) /* if port isn't from string, 
> */
>
>                      client_addr.sin_port = 0; /* ... clear it */
>
>                  return netsnmp_udpipv4base_transport_with_source(addr, local,
>
>
> Thanks,
>
> Bart.
>
>
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to