On Sun, Apr 11, 2010 at 08:47:38PM +0200, Toni Mueller wrote: > Hi, > > I've created a rough patch that should fix the immediate problem, but > is certainly far from perfect (yet). Things to note: > > * No IPv6 support (I have no clue). > * No useful error messages - I want to log data about the offending > site, so admins can go after them. > * For some reason I don't yet understand, logging the IP numbers does > not work properly. While the correct IP numbers are logged in hex > code, the same string is emitted for all three IP numbers, > representing the first IP number passed.
inet_ntoa will return pointer to a static buffer. Each call to it will override thsi buffer with the new IP info. To fix this, you will need to copy returned value to your own local buffers and use those in your "log" statement(s). HTH, --patrick [dd] > + printf("on_pfkey_check_tdb(tdb at %016lx) addresses: src=%s (%08lx), > dst=%s (%08lx), proxy=%s (%08lx)\n", > + newsa, > + inet_ntoa(src->sin.sin_addr), > + src->sin.sin_addr, > + inet_ntoa(dst->sin.sin_addr), > + dst->sin.sin_addr, > + inet_ntoa(proxy->sin.sin_addr), > + proxy->sin.sin_addr);