patch for bug #1693039 - snmpd now prints "Duplicate IP address detected, some interfaces may not be visible in IP-MIB" when an IP address is already known. And, most important, it displays the notice only once, not every 20 sec.
Please note that I have introduced new CONTAINER_TRY_INSERT function - it's not nice, but it works. Comments are welcome.
Patch is for ver. 5.3.1
Logged In: YES
user_id=76242
Originator: NO
Thouhghts on this:
1) I like it.
2) It walks the line of new feature vs bug and I'm not sure where it should get applied outside of trunk. Comments from others appreciated.
3) doesn't currently apply cleanly to trunk, but easy to fix I'm sure.
Logged In: YES
user_id=848638
Originator: NO
I'd certainly support to apply this to the affected branches as well.
Logged In: YES
user_id=76148
Originator: NO
My thoughts..
1) I like it too
2) Why not just modify CONTAINER_INSERT?
3) Container options should be taken into account. eg the find checks should be ignored if CONTAINER_KEY_ALLOW_DUPLICATES option is set.
4) 5.3.x and later have an otions function to access options. 5.2.x does not.
5) the find can also be skipped if, after the rewind to the first container, x->next is NULL.
6) I'd also suggest a new option, say CONTAINER_KEY_ALL_OR_NONE, so that the check is only done when the flag is set.
7) Hmmmmm. But options are, so far, used to influence internal container operation, and this is for behaviour external to an individual container. So, the real container solution is probably to eliminate the whole idea of a linked list of containers, and instead introduce a 'container container' to handle multiple containers. This is obviously not doable for 5.4.x and earlier, but would work for main. It would simplify the CONTAINER_* macros...
Anyways, I suggest that 2-6 be implemented, and we leave 5.2.x as WONT FIX.
Logged In: YES
user_id=1784238
Originator: YES
1) thanks
2) I was simply afraid to modify the function which is used everywhere - I am not able to judge all consequences.
3-5) ok
6) I do not think this is necessary - without the flag (=now), having container with two indexes and the CONTAINER_INSERT failing on duplicity of the second index, you have the entry in first index only. That means that the entry is not visible if you use the second index for lookup, which is IMHO inconsistent and will lead to memory leaks or segfaults. I would suggest to check for duplicities in any case (respecting CONTAINER_KEY_ALLOW_DUPLICATES) and do not allow the INSERT if it would fail.
I attached new patches - both for HEAD and 5.3.1: net-snmp-5.3.1-shared-ip-2.patch, net-snmp-head-shared-ip-2.patch.
Again, I kindly ask for review. I aggressively modified CONTAINER_INSERT and added new flag - CONTAINER_SILENT, making CONTAINER_INSERT to shut up on error. I modified ipaddress_common.c to set the flag (although I am not 100% sure I found the right place to set it) and tweaked container_binary_array to support flags.
File Added: net-snmp-5.3.1-shared-ip-2.patch
Logged In: YES
user_id=1784238
Originator: YES
File Added: net-snmp-head-shared-ip-2.patch
Logged In: YES
user_id=848638
Originator: NO
Thanks, Jan.
@rstory: can we get this into 5.4.1, preferrably before rc1?
Logged In: YES
user_id=1084384
Originator: NO
I've ported this patch to 5.4.1. Anyone who wishes it: ftp://avenger.us.to/pub/patches/net-snmp-5.4.1-ip-2.patch
btw, no problem if one upload this patch to this section :) I just don't think I myself can do it.
Logged In: YES
user_id=848638
Originator: NO
@rstory: any objections to finally apply the patch?
File Added: net-snmp-5.4.1-ip-2.patch
Logged In: YES
user_id=1784238
Originator: YES
I fixed the patches so _netsnmp_ioctl_ipaddress_container_load_v4 and _load6 do not propagate error code from CONTAINER_INSERT in certain situations.
File Added: net-snmp-5.3.1-shared-ip-3.patch
Logged In: YES
user_id=1784238
Originator: YES
File Added: net-snmp-head-shared-ip-3.patch
Logged In: YES
user_id=848638
Originator: NO
The patch against 5.3.1 is reported as malformed for me:
patch -p0 < net-snmp-5.3.1-shared-ip-3.patch
...
patching file agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
patch: **** malformed patch at line 264: fclose(in);
Can you please double-check/update the patch?
Also, is the HEAD patch supposed to apply cleanly to the 5.4.x and 5.3.x SVN branches, too?
Logged In: YES
user_id=848638
Originator: NO
Also, the patch triggers the following compiler warning all over the place:
../../include/net-snmp/library/container.h: In function 'CONTAINER_INSERT':
../../include/net-snmp/library/container.h:397: warning: assignment makes integer from pointer without a cast
line 397 in trunk is:
Please address (and use the CONTAINER_FIND macro).
Logged In: YES
user_id=1784238
Originator: YES
Oh well, never send a patch on Friday :). I am attaching fixed version:
- use correct type when searching container for possible duplicities
- check compilation on 5.3, 5.4 and HEAD branches
The patch for 5.3 works also on 5.4 branch.
File Added: net-snmp-5.3-shared-ip-4.patch
Logged In: YES
user_id=1784238
Originator: YES
File Added: net-snmp-head-shared-ip-4.patch
Logged In: YES
user_id=1018208
Originator: NO
Guys any chances to commit this patch. This fixes crash, reported here:
http://sourceforge.net/mailarchive/message.php?msg_id=c64ae3380711050655n47f5e3daxdd0f22513499e8db%40mail.gmail.com
and for another man here:
https://bugs.gentoo.org/show_bug.cgi?id=203127
Alternate solution
Logged In: YES
user_id=1124910
Originator: NO
Attached is an alternate patch on the same theme but more optimistic.
Instead of filtering every insert twice I add them as I go and then I
remove them if some insert down the line fails. The drawbacks of this
are
* I use more stack memory
* If a container allows multiple entries then if the second insert
fails in a subsequent container then I cant remove the new entry
from this container as there is nothing that distinguishes the new
entry from the old one.
the advantages are
* I do not do any find - the one dne by insert is enough
* I only call insert_filter once for each insert
I would appreciate if you could review my patch as well.
I have chosen not to add the silent flag as that, in my opinion, should be handled as a separate patch
File Added: container-atomic-insert.patch
Logged In: YES
user_id=76242
Originator: NO
Tried to apply magfr's patch but it failed to apply; didn't look into why...
Logged In: YES
user_id=1124910
Originator: NO
I suppose the reason that it failed was that I already have applied it.
r16804.
I did not close this issue since my patch only solved the container problem and not the problems in IP-MIB.
Logged In: YES
user_id=2054712
Originator: NO
Hi Guys..
Im having huge Issues with the Current Net-SNMP Version which I am using i.e.5.3.2.
I tried querying on the SNMP Net-Snmp-Coders mailing List but received no response.
The Issue that im facing is:
I had to upgrade to 5.3.2 for localized keys support during user creation.
So after i upgraded i started facing the issue on SIGHUP:
2006-04-28 17:22:21 error on subcontainer '' insert (-1)
2006-04-28 17:22:21 error on subcontainer '' insert (-1)
2006-04-28 17:22:21 error on subcontainer '' insert (-1)
My Agent stops responding to Authentication requests and Changing Keys after this point.
Searching on Sourceforge i found that this can be fixed using the Official Patch for the bug:
1473289 5.3.0.1 SIGHUP breaks daemons
I downloaded this patch using the link:
https://sourceforge.net/tracker/download.php?group_id=12694&atid=456380&file_id=175273&aid=1473289
However when i looked into the patch I found that this patch has already been updated in the code for 5.3.2 However the bug still exists.
I wonder what may be the issue.
I found the following Mailing thread regarding a Similar Concern:
http://www.mail-archive.com/net-snmp-users@lists.sourceforge.net/msg09939.html
This lady is also facing the same Issue even after patching the file.
However John has replied with the same patch location in the thread which she has already applied as per her description.
I wonder if the bug exists in the higher versions.
I reckon the bug was reported initially by John and fixed by Robert Story before it was promoted as an official patch.
But I am finding the same issue with 5.3.2 also even tho the bug trial shows that it was checked in to the 5.3.x Branch and main also.
Kindly let me know what may be the issue.
I have to fix the Issue and implement the feature with Localized Keys withing a few days and have been stuck at this point for more than a week now.
Kindly guide me.
I hope I have provided all the information.
magfr's container-atomic-insert.patch was accepted (SVN rev. 16804). Only few bits are to be fixed:
- the CONTAINER_INSERT should log with LOG_DEBUG severity (fixed now in SVN rev. 17254, 17257)
- the caller of CONAINER_INSERT should report error
- already done in ipaddress_ioctl.c (SVN rev. 16381)
- fixed now in ipaddress_linux.c (SVN rev. 17255, 17256)
Thanks for the patch! It has been applied to the 5.2.x, 5.3.x and 5.4.x code branches and the main development tree, and will appear in future releases of the Net-SNMP package.
nihao