On Monday 16 June 2003 04:01 pm, Mike Tremaine wrote:
So following my old post from 2.2_patches
http://lists.ntop.org/pipermail/ntop/2003-May/005373.html
I was able to patch report.c and reportUtils.c and now have a full working (as
far as I can tell) Ntop 2.2.2 on Solaris 9 (I'm going to now go do the
Solaris 8 patching).
Here are the patches again
[EMAIL PROTECTED] ~/ntop_cvs/ntop [143] cvs diff report.c
Index: report.c
===================================================================
RCS file: /export/home/ntop/ntop/report.c,v
retrieving revision 2.138
diff -r2.138 report.c
620c620,622
< snprintf(buf, sizeof(buf), "%s/interfaces/%s", myGlobals.rrdPath,
---
> snprintf(buf, sizeof(buf), "%s/interfaces/%s", myGlobals.rrdPath != NULL
?
> myGlobals.rrdPath :
> "",
[EMAIL PROTECTED] ~/ntop_cvs/ntop [144] cvs diff reportUtils.c
Index: reportUtils.c
===================================================================
RCS file: /export/home/ntop/ntop/reportUtils.c,v
retrieving revision 2.138
diff -r2.138 reportUtils.c
3478c3478,3480
< snprintf(buf, sizeof(buf), "%s/interfaces/%s/hosts/%s",
myGlobals.rrdPath,
---
> snprintf(buf, sizeof(buf), "%s/interfaces/%s/hosts/%s",
myGlobals.rrdPath != NULL ?
> myGlobals.rrdPath :
> "",
I saved my GDB output and attached it incase a developer wants to see it.
> [Disclaimer]
> I have no idea what I'm doing. Ntop is forcing me to learn C (The O'Reilly
> people just made another 39bucks from me...)
> [/Disclaimer]
>
> After hacking around for days at pbuf.c I found a way to get it to run on
> my test box (Solaris 9)
>
> Here it is.....
>
> [EMAIL PROTECTED] ~/ntop_cvs/ntop [123] cvs diff pbuf.c
> Index: pbuf.c
> ===================================================================
> RCS file: /export/home/ntop/ntop/pbuf.c,v
> retrieving revision 2.122
> diff -r2.122 pbuf.c
> 902c902
> < u_char *tcp_data = (u_char *)((int)tcp + tcp->th_off * 4);
> ---
>
> > u_char *tcp_data = (u_char *)((int)tcp + tp.th_off * 4);
>
> That little change made the start up problems go away. So I have no idea if
> that was a missed change since I see no other tcp->th_off calls but several
> tp.th_off 's....
>
> Now that it is running it has a a problem showing the STATS->TRAFFIC page
> which was the same problem I had back in 2.2 and I hacked around... So I'm
> going back to gdb and my notes to see If I can bring this page up as well.
--
Mike Tremaine
[EMAIL PROTECTED]
GDB for STATS->TRAFFIC
Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 5]
0x7f6b2fb0 in strlen () from /usr/lib/libc.so.1
(gdb) backtrace
#0 0x7f6b2fb0 in strlen () from /usr/lib/libc.so.1
#1 0x7f704f08 in _doprnt () from /usr/lib/libc.so.1
#2 0x7f706b24 in snprintf () from /usr/lib/libc.so.1
#3 0x7faadeb0 in printTrafficStatistics () at report.c:620
#4 0x7faab074 in returnHTTPPage (pageName=0x7eb7bb71 "trafficStats.html", postLen=-1,
from=0x2, httpRequestedAt=0x7eb7ba28,
usedFork=0x7eb7ba18, agent=0x0) at http.c:1836
#5 0x7faac86c in handleHTTPrequest (from=Cannot access memory at address 0x42866377
) at http.c:2427
#6 0x7fadfd60 in handleSingleWebConnection (fdmask=0x1ce080) at webInterface.c:5099
#7 0x7fadfb6c in handleWebConnections (notUsed=0x1) at webInterface.c:4964
GDB for any IP host (non mac address) IE http:/NTOP:3000/192.168.45.10.html
Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 5]
0x7f6b2fb0 in strlen () from /usr/lib/libc.so.1
(gdb) backtrace
#0 0x7f6b2fb0 in strlen () from /usr/lib/libc.so.1
#1 0x7f704f08 in _doprnt () from /usr/lib/libc.so.1
#2 0x7f706b24 in snprintf () from /usr/lib/libc.so.1
#3 0x7fad0e30 in printHostDetailedInfo (el=0x8fe08, actualDeviceId=6136) at
reportUtils.c:3478
#4 0x7fab6754 in printAllSessionsHTML (host=0x7eb7b498 "192.168.45.12",
actualDeviceId=0) at report.c:1737
#5 0x7faabe64 in returnHTTPPage (pageName=0x7eb7bb71 "192.168.45.12", postLen=-1,
from=0x2, httpRequestedAt=0x7eb7ba28,
usedFork=0x7eb7ba18, agent=0x0) at http.c:2075
#6 0x7faac86c in handleHTTPrequest (from=Cannot access memory at address 0x42866377
) at http.c:2427
#7 0x7fadfd60 in handleSingleWebConnection (fdmask=0x1ce080) at webInterface.c:5099
#8 0x7fadfb6c in handleWebConnections (notUsed=0x1) at webInterface.c:4964