bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] [RFC] [PATCH] inetd: Change protocol semantics in in


From: Guillem Jover
Subject: Re: [bug-inetutils] [RFC] [PATCH] inetd: Change protocol semantics in inetd.conf
Date: Thu, 18 Nov 2010 05:19:20 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Mon, 2010-10-18 at 12:47:34 -0400, Alfred M. Szmidt wrote:
> Applied.  Thanks!

You applied a modified version of my patch, which introcued few
issues.

> diff --git a/src/inetd.c b/src/inetd.c
> index 9a43271..0f09386 100644
> --- a/src/inetd.c
> +++ b/src/inetd.c
> @@ -1001,9 +1002,8 @@ getconfigent (FILE *fconfig, const char *file, size_t 
> *line)
>        sep->se_proto = newstr (argv[INETD_PROTOCOL]);
>  
>  #ifdef IPV6
> -      /* We default to IPv6.  In setup() we'll fall back to IPv4 if
> -         it doesn't work.  */
> -      sep->se_family = AF_INET6;
> +      /* We default to IPv4. */

Missing space here.

> +      sep->se_family = AF_INET;
>        sep->se_v4mapped = 1;

In my patch I changed this to 0, because it does not make sense to
have v4mapped addresses in AF_INET, and this is what broke it for
FreeBSD, and what prompted Mats patch which would be unneecessary
otherwise.

>       if ((strncmp (sep->se_proto, "tcp", 3) == 0)
> @@ -1013,6 +1013,9 @@ getconfigent (FILE *fconfig, const char *file, size_t 
> *line)
>           {
>             sep->se_family = AF_INET6;
>             sep->se_v4mapped = 0;
> +           /* Check for tcp6only and udp6only.  */
> +           if (strcmp (&sep->se_proto[3], "6only") == 0)
> +             sep->se_v4mapped = 0;
>           }

This always sets se_v4mapped to 0 for IPv6. I used the else construct
here to be resilient against future default changes, even if slightly
redundant (resetting it to 0), although more future proof.

>         else if (sep->se_proto[3] == '4')
>           {

regards,
guillem



reply via email to

[Prev in Thread] Current Thread [Next in Thread]