[pkg-ntp-maintainers] Bug#492472: ntpd fails to set IP TOS (type of service) bits

Vincent Zweije vincent at zweije.nl.eu.org
Sat Jul 26 12:38:13 UTC 2008


Package: ntp
Version: 1:4.2.4p4+dfsg-7
Severity: normal
Tags: patch

Running tcpdump -v shows that ntpd is not setting the IP type of service
to optimize for low delay.

The code to do this is there in the sources, so the intention is
definitely that the bit should be set. However, it is not activated
because:

  * it depends on IPTOS_LOWDELAY being defined,

  * IPTOS_LOWDELAY is defined in netinet/ip.h, but

  * netinet/ip.h is not included.

The patch below adds the inclusion of netinet/ip.h. As a result, TOS
bits are now set in my locally compiled version:

14:23:51.869725 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 76) sense.xs4all.nl.ntp > monitorul.suceava.rdsnet.ro.55672: NTPv4, length 48
        Server, Leap indicator: clock unsynchronized (192), Stratum 0, poll 6s, precision -20
        [...]

the tos 0x10 is the bit I meant. This was tos 0x0 before the patch.

    --- ntpd/ntp_io.c.orig	2008-07-26 14:25:28.000000000 +0200
    +++ ntpd/ntp_io.c	2008-07-26 14:13:32.000000000 +0200
    @@ -41,6 +41,9 @@
     #ifdef HAVE_SYS_UIO_H
     # include <sys/uio.h>
     #endif
    +#ifdef HAVE_NETINET_IP_H
    +# include <netinet/ip.h>
    +#endif
     
     /*
      * setsockopt does not always have the same arg declaration

Ciao.                                                        Vincent.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages ntp depends on:
ii  adduser                  3.108           add and remove users and groups
ii  libc6                    2.7-10          GNU C Library: Shared libraries
ii  libcap1                  1:1.10-14       support for getting/setting POSIX.
ii  libedit2                 2.11~20080614-1 BSD editline and history libraries
ii  libncurses5              5.6+20080308-1  Shared libraries for terminal hand
ii  libssl0.9.8              0.9.8g-10.1     SSL shared libraries
ii  lsb-base                 3.2-12          Linux Standard Base 3.2 init scrip
ii  netbase                  4.32            Basic TCP/IP networking system

Versions of packages ntp recommends:
ii  perl                          5.10.0-11  Larry Wall's Practical Extraction 

Versions of packages ntp suggests:
ii  ntp-doc                 1:4.2.4p4+dfsg-6 Network Time Protocol documentatio

-- no debconf information
-- 
Vincent Zweije <zweije at xs4all.nl>    | "If you're flamed in a group you
<http://www.xs4all.nl/~zweije/>      | don't read, does anybody get burnt?"
[Xhost should be taken out and shot] |            -- Paul Tomblin on a.s.r.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-ntp-maintainers/attachments/20080726/2bc733f3/attachment.pgp 


More information about the pkg-ntp-maintainers mailing list