Subject: Re: support for int option value in setsockopt(, IPPROTO_IP, IP_MULTICAST_TTL,,)
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-kern
Date: 09/11/2005 13:54:06
In article <20050910221144.GL875@veracruz.ssr.univ-paris7.fr>,
Stoned Elipot  <seb@ssr.univ-paris7.fr> wrote:
>-=-=-=-=-=-
>
>Hi,
>I've been wondering why ntpd stopped working in my usual multicast
>setup since ntp 4.x import. Yes it had been quite some time since then :)
>
>Anyway, ntpd in src/dist/ntp/ntpd/ntp_io.c sets the TTL of outgoing multicast
>packets via an int option value argument to setsockopt(), search for
>IP_MULTICAST_TTL in this source file... This fail because
>netinet/ip_output.c:ip_setmoptions() check that the option value
>for IP_MULTICAST_TTL is one byte long, it bails out otherwise.
>
>Then I noticed that FreeBSD's code allows for an int type option value
>in the same situation, see the same fonction in the same source file of
>FreeBSD's kernel.
>
>So instead of "fixing" ntpd's sources I had a try to make a similar change
>in NetBSD's ip_setmoptions().
>
>The attached patch contains this change, I tested it successfully on
>i386 3.99.8 current and sparc64 2.0_STABLE.
>
>I'd like to hear your opinions on this as I'd like to commit such a change.
>

This looks good. I'd say go ahead.

christos