Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 109829 - ulogd does not log TOS ip header field correctly
Summary: ulogd does not log TOS ip header field correctly
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-19 10:08 UTC by Jan Safrata
Modified: 2006-12-16 14:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Safrata 2005-10-19 10:08:41 UTC
Zero value is logged instead of TOS ip header field.
It is caused by use of ntohs() function for __u8 type of tos field of struct
iphdr, so the real value is lost on little endian architectures.

Here is a patch to fix it:

diff -rc ulogd-1.02/extensions/ulogd_BASE.c
ulogd-1.02-tosfix/extensions/ulogd_BASE.c
*** ulogd-1.02/extensions/ulogd_BASE.c  2003-08-23 19:46:45.000000000 +0200
--- ulogd-1.02-tosfix/extensions/ulogd_BASE.c   2005-10-19 18:32:04.000000000 +0200
***************
*** 173,179 ****
        ret[1].flags |= ULOGD_RETF_VALID;
        ret[2].value.ui8 = iph->protocol;
        ret[2].flags |= ULOGD_RETF_VALID;
!       ret[3].value.ui8 = ntohs(iph->tos);
        ret[3].flags |= ULOGD_RETF_VALID;
        ret[4].value.ui8 = iph->ttl;
        ret[4].flags |= ULOGD_RETF_VALID;
--- 173,179 ----
        ret[1].flags |= ULOGD_RETF_VALID;
        ret[2].value.ui8 = iph->protocol;
        ret[2].flags |= ULOGD_RETF_VALID;
!       ret[3].value.ui8 = iph->tos;
        ret[3].flags |= ULOGD_RETF_VALID;
        ret[4].value.ui8 = iph->ttl;
        ret[4].flags |= ULOGD_RETF_VALID;
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-11-11 10:05:58 UTC
Re-assign.
Comment 2 Charlie Shepherd (RETIRED) gentoo-dev 2006-12-16 14:02:06 UTC
Thanks for the patch, but we need in it in unified diff format (diff -ur)