Re: net-snmp fails to create entries with a zero in the OID in SnmpTargetParamsEntry

2013-11-26 Thread zhuyj
On 11/26/2013 02:52 PM, Magnus Fromreide wrote:
> On Mon, 2013-11-25 at 19:04 +0800, zhuyj wrote:
>> On 11/25/2013 02:34 AM, Magnus Fromreide wrote:
>>> On Fri, 2013-11-22 at 14:27 +0800, zhuyj wrote:
 4.patch -p1 < V5-7-patches-snmpTargetParam_support_zero_OID.patch
>>> snmpTargetAddrEntry.c:
>>> Chunk #2 is unnecessary - setting members to 0 before freeing the
>>>   object they are members of.
>>>
>>> snmpTargetAddrEntry.h:
>>> Putting the variable in the hole after nameLen will leave the size of
>>> targetAddrTable_struct unchanged while the suggested location will
>>> expand the size of it by 4 (or 8 on 64-bit) bytes.
>>>
>>> snmpTargetParamsEntry.c:
>>> Chunk #2 is unnecessary - setting a member to 0 before freeing the
>>>   object it is a member of.
>>> Chunk #9? (get_paramEntry) - it would be more efficient and correct
>>>to check that nameLen == ptr->paramNameLen before memcmp'ing
>>>name and paramName, in particular if nameLen < paramNameLen.
>>>
>>> target.c:
>>> Certificate lookup under DTLS uses only the part of the name up to the
>>> first '\0'.
>> Hi, MF
>>
>> I agree with other advices from you. But I do not understand this:
>> target.c:
>> Certificate lookup under DTLS uses only the part of the name up to the
>> first '\0'.
>>
>> Would you like to explain this in details? Thanks a lot.
> Sure.
>
> target/target.c:205
>
>   cert = netsnmp_cert_find(NS_CERT_IDENTITY, NS_CERTKEY_TARGET_PARAM,
>targaddrs->params);
Hi, Magnus

Maybe there is something wrong with snmptlstmtable since this table uses 
snmptargetparam as index.
I will make a new patch for this soon.

Best Regards!
Zhu Yanjun
> Now, assume that targaddrs->params contains embedded NUL characters.
  patch -p1 < V5-7-patches-fix-param-length.patch
  patch -p1 < V5-7-patches-conf-support.patch
>>> Why the memset's before read_config_save_octet_string?
>> An example is as below.
>>
>> If variable tmp is used as the line1, there are 6 'x' in this variable
>> tmp.
>> we will copy 4 'y' to tmp, now the variable tmp is as below line2 if
>> we do not
>> memset tmp. It is not what we expect.
>>
>> line1: tmp:   xx
>> line2: using: xx
> You can't use NUL as a end of string marker since NUL is a perfectly
> valid character. When handing strings to printf you get around that with
>
> printf("%.*s", tmp, 4);
>
> For other methods one usually have to add a method that takes a string
> width.
>
> /MF
>
>


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: Compilation issue on HPUX

2013-11-26 Thread Niels Baggesen
Den 26-11-2013 12:30, Felipe Souza skrev:
> weird.. I had installed gcc using depot file for HP PA-RISC.
>
> gcc depot:
> gcc-4.2.3-hppa-11.31.depot
>
> depencies depot:
> libgcc-4.2.3-hppa-11.31.depot
> zlib-1.2.8-hppa-11.31.depot
>
> # swlist |grep -i gcc
>gcc   4.2.3  gcc
>libgcc4.2.3  libgcc

Something is certainly amiss with that gcc installation, and not being 
an HP-UX man I cannot help you there.

Any HP-UX admins lurking around?

/Niels

-- 
Niels Baggesen - @home - Århus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming

--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: Compilation issue on HPUX

2013-11-26 Thread Niels Baggesen
Den 26-11-2013 11:45, Felipe Souza skrev:
> Hi Niels..
>
> the config.log is attached.

Did you try to look into config.log yourself?

configure:6571: checking for gcc
configure:6587: found /usr/local/bin/gcc
configure:6598: result: gcc
configure:6827: checking for C compiler version
configure:6836: gcc --version >&5
/usr/lib/dld.sl: Unresolved symbol: libintl_bindtextdomain (code)  from gcc
./configure[6838]: 15518 Abort(coredump)
configure:6847: $? = 134

How did you install that gcc? It does not seem to match your system!

/Niels

-- 
Niels Baggesen - @home - Århus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming

--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Fwd: Re: Compilation issue on HPUX

2013-11-26 Thread Niels Baggesen
Den 25-11-2013 20:56, Felipe Souza skrev:
> Hi Niels,
>
> Thanks for your reply.

Please keep the list CC'ed too

> checking for gcc... gcc
> checking whether the C compiler works... no
> configure: error: in `/tmp/net-snmp-5.7.2':
> configure: error: C compiler cannot create executables

What does it say in config.log?

/Niels

-- 
Niels Baggesen - @home - Århus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders