> I'm not that good at coding, so I'm not seeing what you're 
> talking about.  I would say make a backup copy, modify as you 
> see fit, and recompile.  What's the worst that can happen?

I dread to think :)

For the original problem, it's just an index that's wrong.
Starting at line 423 in address.c, it's taking each byte and
stuffing it into a string with the colon separators in place.
But the fourth byte (index 3) is there twice and the fifth
byte (index 4) is missing. Just changing the second 3 to a
4 solves the problem and ntop is showing correct MAC
addresses again.

The segfault when I compiled without PARM_USE_MACHASH_INVERT
is more of a guess. The conditional block at line 185 in
vendor.c sets "ipxsapValue" if we are inverting (default) but
sets "idx" otherwise. On the next line, "idx" is unconditionally
set to a value derived from "ipxsapValue" which, if we are not
inverting, has will not have been assigned any value.

It may be that the "else" clause should be setting "ipxsapValue"
and not "idx", but I don't know if the rest of that line would
be correct in that case. The other option is that the conditional
statement should apply to "idx", like so:

  ipxsapValue = 256*256*(unsigned long)(entry->ipxsapId & 0xff)
    + 256*(unsigned long)((entry->ipxsapId >> 8) & 0xff)
    + (unsigned long)((entry->ipxsapId >> 16) & 0xff);
  #ifdef PARM_USE_MACHASH_INVERT
    idx = (u_int)(entry->ipxsapId % tableLen);
  #else
    idx = (u_int)((u_int)ipxsapValue % tableLen);
  #endif


Cheers, Phil.

**********************************************************************************
This email and any files transmitted with it are confidential and intended 
solely
for the use of the individual or entity to whom they are addressed. If you have
received this email in error please notify the NHS Borders Servicedesk on
01896 82 77 77.

Opinions expressed herein are those of the sender and do NOT represent the
corporate position of NHS  Borders

This footnote also confirms that this email message has been swept by 
MIMEsweeper.

*** NHS Borders 
*******************************************************************

_______________________________________________
Ntop mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop

Reply via email to