1 |
pva 07/12/27 17:15:33 |
2 |
|
3 |
Modified: net-snmp-5.4.1-clientaddr-fix.patch |
4 |
Added: digest-net-snmp-5.4.1-r2 |
5 |
net-snmp-5.4.1-suppresssuppress-annoying.patch |
6 |
Log: |
7 |
Fixes memory leaks reported in bug #180266, thank Doug <doug.manley AT gmail.com> for report and ivestigation. Added upstream patch to suppress annoying "registration != duplicate" warning for root oids. |
8 |
(Portage version: 2.1.3.19) |
9 |
|
10 |
Revision Changes Path |
11 |
1.2 net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch?rev=1.2&view=markup |
14 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch?rev=1.2&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch?r1=1.1&r2=1.2 |
16 |
|
17 |
Index: net-snmp-5.4.1-clientaddr-fix.patch |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch,v |
20 |
retrieving revision 1.1 |
21 |
retrieving revision 1.2 |
22 |
diff -u -r1.1 -r1.2 |
23 |
--- net-snmp-5.4.1-clientaddr-fix.patch 17 Aug 2007 01:13:43 -0000 1.1 |
24 |
+++ net-snmp-5.4.1-clientaddr-fix.patch 27 Dec 2007 17:15:33 -0000 1.2 |
25 |
@@ -1,4 +1,4 @@ |
26 |
-Fix clientaddr functionality. |
27 |
+Fix clientaddr functionality. Includes further memory leak and newline fixes. |
28 |
|
29 |
Previously, the clientaddr option in snmp.conf was parsed, but the actual |
30 |
clientaddr was used to bind(), yet sendmsg() was still called with 0.0.0.0. |
31 |
@@ -13,22 +13,30 @@ |
32 |
Status: Merged in upstream r16654 |
33 |
Tracking-URL: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=1775124&group_id=12694 |
34 |
|
35 |
-diff -NuwbBar --exclude docs --exclude '*.o' --exclude 'config.*' --exclude perl --exclude '*~' net-snmp-5.4.old/snmplib/snmpUDPDomain.c net-snmp-5.4/snmplib/snmpUDPDomain.c |
36 |
---- net-snmp-5.4.old/snmplib/snmpUDPDomain.c 2006-09-19 16:42:17.000000000 -0700 |
37 |
-+++ net-snmp-5.4/snmplib/snmpUDPDomain.c 2007-08-15 19:17:27.000000000 -0700 |
38 |
-@@ -100,12 +100,15 @@ netsnmp_udp_fmtaddr(netsnmp_transport *t |
39 |
- struct sockaddr_in *to = NULL; |
40 |
+Further fixes: |
41 |
+Revision 16681 |
42 |
+ add missing newline in debug msg |
43 |
+Revision 16704 |
44 |
+ CHANGES: snmplib: BUG: Coverity #183: fix memory leak if IP_PKTINFO fails |
45 |
+Revision 16716 |
46 |
+ CHANGES: snmplib: Do not leak memory whenever an udp address is formatted. |
47 |
+ |
48 |
+Fixes bug: bugs.gentoo.org/180266 |
49 |
+ |
50 |
+diff -Naur net-snmp-5.4.1.orig/snmplib/snmpUDPDomain.c net-snmp-5.4.1/snmplib/snmpUDPDomain.c |
51 |
+--- net-snmp-5.4.1.orig/snmplib/snmpUDPDomain.c 2007-06-11 02:15:24.000000000 +0400 |
52 |
++++ net-snmp-5.4.1/snmplib/snmpUDPDomain.c 2007-12-27 18:15:56.000000000 +0300 |
53 |
+@@ -104,11 +104,13 @@ |
54 |
char tmp[64]; |
55 |
to = (struct sockaddr_in *) &(addr_pair->remote_addr); |
56 |
-+ /* Using strdup on the output of inet_ntoa is important! */ |
57 |
if (to == NULL) { |
58 |
- return strdup("UDP: unknown"); |
59 |
+ sprintf(tmp, "UDP: [%s]->unknown", |
60 |
-+ strdup(inet_ntoa(addr_pair->local_addr))); |
61 |
++ inet_ntoa(addr_pair->local_addr)); |
62 |
+ } else { |
63 |
-+ sprintf(tmp, "UDP: [%s]->[%s]:%hu", |
64 |
-+ strdup(inet_ntoa(addr_pair->local_addr)), |
65 |
-+ strdup(inet_ntoa(to->sin_addr)), ntohs(to->sin_port)); |
66 |
++ sprintf(tmp, "UDP: [%s]->", inet_ntoa(addr_pair->local_addr)); |
67 |
++ sprintf(tmp + strlen(tmp), "[%s]:%hd", |
68 |
++ inet_ntoa(to->sin_addr), ntohs(to->sin_port)); |
69 |
} |
70 |
- |
71 |
- sprintf(tmp, "UDP: [%s]:%hu", |
72 |
@@ -36,28 +44,52 @@ |
73 |
return strdup(tmp); |
74 |
} |
75 |
} |
76 |
-@@ -670,11 +673,23 @@ netsnmp_udp_transport(struct sockaddr_in |
77 |
- NETSNMP_DS_LIB_CLIENT_ADDR); |
78 |
+@@ -642,6 +644,7 @@ |
79 |
+ if (setsockopt(t->sock, SOL_IP, IP_PKTINFO, &sockopt, sizeof sockopt) == -1) { |
80 |
+ DEBUGMSGTL(("netsnmp_udp", "couldn't set IP_PKTINFO: %s\n", |
81 |
+ strerror(errno))); |
82 |
++ netsnmp_transport_free(t); |
83 |
+ return NULL; |
84 |
+ } |
85 |
+ DEBUGMSGTL(("netsnmp_udp", "set IP_PKTINFO\n")); |
86 |
+@@ -667,10 +670,24 @@ |
87 |
if (client_socket) { |
88 |
struct sockaddr_in client_addr; |
89 |
-+ int ret; |
90 |
netsnmp_sockaddr_in2(&client_addr, client_socket, NULL); |
91 |
+ addr_pair.local_addr = client_addr.sin_addr; |
92 |
client_addr.sin_port = 0; |
93 |
- bind(t->sock, (struct sockaddr *)&client_addr, |
94 |
-+ ret = bind(t->sock, (struct sockaddr *)&client_addr, |
95 |
++ rc = bind(t->sock, (struct sockaddr *)&client_addr, |
96 |
sizeof(struct sockaddr)); |
97 |
-+ if(ret) |
98 |
++ if ( rc != 0 ) { |
99 |
+ DEBUGMSGTL(("netsnmp_udp", "failed to bind for clientaddr: %d %s\n", |
100 |
-+ errno,strerror(errno))); |
101 |
-+ /* TODO: should we exit here? */ |
102 |
++ errno, strerror(errno))); |
103 |
++ netsnmp_udp_close(t); |
104 |
++ netsnmp_transport_free(t); |
105 |
++ return NULL; |
106 |
++ } |
107 |
} |
108 |
+ |
109 |
-+ str = netsnmp_udp_fmtaddr(NULL, (void *)&addr_pair, |
110 |
-+ sizeof(netsnmp_udp_addr_pair)); |
111 |
++ str = netsnmp_udp_fmtaddr(NULL, (void *)&addr_pair, |
112 |
++ sizeof(netsnmp_udp_addr_pair)); |
113 |
+ DEBUGMSGTL(("netsnmp_udp", "client open %s\n", str)); |
114 |
+ free(str); |
115 |
+ |
116 |
/* |
117 |
* Save the (remote) address in the |
118 |
* transport-specific data pointer for later use by netsnmp_udp_send. |
119 |
+@@ -839,12 +856,12 @@ |
120 |
+ if (host == NULL) { |
121 |
+ DEBUGMSGTL(("netsnmp_sockaddr_in", |
122 |
+ "servname not numeric, " |
123 |
+- "check if it really is a destination)")); |
124 |
++ "check if it really is a destination)\n")); |
125 |
+ host = port; |
126 |
+ port = NULL; |
127 |
+ } else { |
128 |
+ DEBUGMSGTL(("netsnmp_sockaddr_in", |
129 |
+- "servname not numeric")); |
130 |
++ "servname not numeric\n")); |
131 |
+ free(peername); |
132 |
+ return 0; |
133 |
+ } |
134 |
|
135 |
|
136 |
|
137 |
1.1 net-analyzer/net-snmp/files/digest-net-snmp-5.4.1-r2 |
138 |
|
139 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/net-snmp/files/digest-net-snmp-5.4.1-r2?rev=1.1&view=markup |
140 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/net-snmp/files/digest-net-snmp-5.4.1-r2?rev=1.1&content-type=text/plain |
141 |
|
142 |
Index: digest-net-snmp-5.4.1-r2 |
143 |
=================================================================== |
144 |
MD5 6c974df7a5a5b1579f72115e6b045bda net-snmp-5.4.1.tar.gz 5122455 |
145 |
RMD160 3723488dab8d164702a7d55c9c72eeaec07dd50c net-snmp-5.4.1.tar.gz 5122455 |
146 |
SHA256 0ea976722c993c87dede8eb6348e6feb059e3851bbef2de824bf18ac97cdb565 net-snmp-5.4.1.tar.gz 5122455 |
147 |
|
148 |
|
149 |
|
150 |
1.1 net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch |
151 |
|
152 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch?rev=1.1&view=markup |
153 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch?rev=1.1&content-type=text/plain |
154 |
|
155 |
Index: net-snmp-5.4.1-suppresssuppress-annoying.patch |
156 |
=================================================================== |
157 |
NEWS: agent: suppress annoying "registration != duplicate" warning for root oids |
158 |
(otherwise, you'll get this message on almost every startup) |
159 |
|
160 |
http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=rev&revision=16669 |
161 |
|
162 |
--- branches/V5-4-patches/net-snmp/agent/agent_registry.c 2007/08/20 08:06:42 16668 |
163 |
+++ branches/V5-4-patches/net-snmp/agent/agent_registry.c 2007/08/22 21:56:23 16669 |
164 |
@@ -532,7 +532,8 @@ |
165 |
|
166 |
if (next && (next->namelen == new_sub->namelen) && |
167 |
(next->priority == new_sub->priority)) { |
168 |
- netsnmp_assert(!"registration != duplicate"); /* always false */ |
169 |
+ if (new_sub->namelen != 1) /* ignore root OID dups */ |
170 |
+ netsnmp_assert(!"registration != duplicate"); /* always false */ |
171 |
return MIB_DUPLICATE_REGISTRATION; |
172 |
} |
173 |
|
174 |
|
175 |
|
176 |
|
177 |
-- |
178 |
gentoo-commits@g.o mailing list |