On Fri, 2011-01-07 at 14:13 -0800, Wes Hardaker wrote: > On Thu, 6 Jan 2011 18:46:11 +0100 Bart wrote: > BVA> Are the original transport data structure and its copy modified > BVA> independently of each other - if these are ever modified ? If not, a > BVA> possible alternative is to use reference counting instead of copying. > > RS> I believe Wes added the copy function, so I'll let him answer this one... > > The copy function, I believe, I added because the DTLS transport > creates an initial transport object and then "forks it" to create a new > one with new information in it in order to get around the DTLS bugs in > OpenSSL.
Actually, no, you didn't. The copy function was added in r 6xxx and is used after f_accept in _sess_read (snmplib/snmp_api.c:5811), so I assume that the purpose of it was to copy data from the listening transport to the accepted transport. Now, calling this copying is a somewhat overambitious but I am a bit pressed for a better word. Possibly "clone" is a better word for what it is that is happening? > So, could we use reference counting? Maybe. I'd have to do analysis to > figure it out. Not for the accept use case. So now for the big question: Is this the kind of copying that is wanted in the DTLS code? (And for the small one: Is netsnmp_transport_copy a misleading name?) /MF ------------------------------------------------------------------------------ Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders