[SNMP4J] Re: proxy forwarding in Beta 5

Frank Fock fock at agentpp.com
Fri Aug 4 13:50:35 CEST 2006


Glenn,

Thanks for reporting these bugs. I have fixed them in a new beta 6
a bit differently than you did. I have also added the public access
methods. As a consequence, the beta 6 will not be the last beta ;-)
The new beta 6 can be downloaded from http://www.snmp4j.org

Best regards,
Frank

Glenn Gerhardt (glgerhar) wrote:
>  
> Frank,
> In SNMP4-agent version beta 4, I was able to proxy forward with 
> the combinations (front-side/back-side) v1/v1, v1/v2c, v2c/v1 and
> v2c/v2c.
> Any sort of proxy that included v3 had the exceptions you feel are fixed
>
> in Beta 5.  I have yet to verify those fixes, but will be doing so
> shortly.
>
> However, in version Beta 5 I have found that the previously working 
> proxy combinations have stopped working.  I found that in Beta 5, the 
> request ID of the response on the front side of the proxy was not being 
> set back to that of the original request.  As a result, get request tool
>
> did not recognize the response.
>
> I've made the following changes to ProxyForwarderImpl.forward to correct
> this issue.
> -Glenn
>
>       if ((resp != null) && (resp.getResponse() != null)) {
>         PDU respPDU = resp.getResponse();
>         PDU translatedResponse = DefaultPDUFactory.createPDU(
>             request.getCommandEvent().getSecurityModel());
>         if (!translatedResponse.getClass().equals(respPDU)) {
>           // not required PDU instance -> copy data
>           translatedResponse.setType(respPDU.getType());
>           translatedResponse.addAll(respPDU.toArray());
>           translatedResponse.setErrorIndex(respPDU.getErrorIndex());
>           translatedResponse.setErrorStatus(respPDU.getErrorStatus());
>           // FIX: added to get the original request id in the response
>  
> translatedResponse.setRequestID(request.getCommandEvent().getPDU().getRe
> questID());
>         }
>         else {
>           translatedResponse = respPDU;
>         }
>         // FIX: changed from respPDU to translatedResponse
>         request.setResponsePDU(translatedResponse);
>         return true;
>
>   





More information about the SNMP4J mailing list