On lör, 2006-12-16 at 16:28 +0100, Thomas Anders wrote: > Magnus Fromreide wrote: > > The problem is that snmp_open() calls > > netsnmp_tdomain_transport_full("snmp", ...) and this tells the library > > that when it looks for default values to use then it should use the > > "snmp" domain, and there port 161 is reasonable. In this case we should > > have told it to use the "snmptrap" domain. That is all the patch does. > > > > Another thing is that maybe NETSNMP_DS_LIB_DEFAULT_PORT should have > > higher precedence than the value from the domain transport lookup? > > Shouldn't the fix be in the library code, rather than apps/snmptrap.c?
It should, but the application/example code should be changed to use the more expressive interface as well. > Otherwise, any other existing third-party code doing similar things and > relying > on our backwards-compat promise would hit the same issue, wouldn't it? This is about what I said above, the problem is how they should interact. A) NETSNMP_DS_LIB_DEFAULT_PORT might be set through a) program code b) configuration files c) command line arguments d) environment variables B) defTarget might be set through a) program code b) configuration files c) command line arguments This makes for a decision matrix on which of the parameters to honor the most: Aa Ab Ac Ad Ba 1 A A A Bb B 1 A 2 Bc B B 1 B Legend: A) Honor NETSNMP_DS_LIB_DEFAULT_PORT B) Honor defTarget 1) Here they have equal weight, I am leaning towards A in the name of backwards-compat but a case could be made for B. 2) This one is interesting, but I think this should be an A as environment should trumph config files. and then there is the problem that I do not know what source it is that did set either of the variables so the above is possibly meaningless. With the above said I have to admit that I am preparing a patch to give NETSNMP_DS_LIB_DEFAULT_PORT priority. /MF ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders