Package: ntop
Severity: important
Tags: patch
On Fri, Feb 16, 2007 at 03:33:33PM +0100, David Fabel wrote:
> Hi,
> last year I send patch of Ntop file util.c This patch fix SIGSEGV with using
> netflows on vlan interface. Luca Deri include this fix on your source code.
> Please insert it You too.
>
> For me is this situation critical. This patch not in stable, not in testing
> and not in unstable version on Debian. Is minimal patch, changing only bug,
> not add or restrict function. Is any problem insert it?
>
> Thank you very much.
--
--- Ola Lundqvist systemkonsult --- M Sc in IT Engineering ----
/ [EMAIL PROTECTED] Annebergsslingan 37 \
| [EMAIL PROTECTED] 654 65 KARLSTAD |
| http://opalsys.net/ Mobile: +46 (0)70-332 1551 |
\ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 /
---------------------------------------------------------------
--- util.c-3.2 2007-02-16 15:23:58.000000000 +0100
+++ util.c-3.3 2006-12-20 09:51:31.000000000 +0100
@@ -1713,19 +1713,24 @@
newFlow->fcode = (struct bpf_program*)calloc(myGlobals.numDevices,
sizeof(struct bpf_program));
for(i=0; i<myGlobals.numDevices; i++) {
- rc = pcap_compile(myGlobals.device[i].pcapPtr,
&newFlow->fcode[i],
- flowSpec, 1,
myGlobals.device[i].netmask.s_addr);
-
- if(rc < 0) {
- traceEvent(CONST_TRACE_WARNING, "Wrong flow specification
\"%s\" (syntax error). "
- "It has been ignored.", flowSpec);
- free(newFlow);
-
- /* Not used anymore */
- free(myGlobals.runningPref.flowSpecs);
- myGlobals.runningPref.flowSpecs = strdup("Error, wrong flow
specification");
- return;
- }
+ if(myGlobals.device[i].pcapPtr
+ && (!myGlobals.device[i].virtualDevice)
+ /* Fix courtesy of David Fabel <[EMAIL PROTECTED]> */
+ ) {
+ rc = pcap_compile(myGlobals.device[i].pcapPtr,
&newFlow->fcode[i],
+ flowSpec, 1,
myGlobals.device[i].netmask.s_addr);
+
+ if(rc < 0) {
+ traceEvent(CONST_TRACE_WARNING, "Wrong flow specification
\"%s\" (syntax error). "
+ "It has been ignored.", flowSpec);
+ free(newFlow);
+
+ /* Not used anymore */
+ free(myGlobals.runningPref.flowSpecs);
+ myGlobals.runningPref.flowSpecs = strdup("Error, wrong flow
specification");
+ return;
+ }
+ }
}
newFlow->flowName = strdup(flowName);