PATCH: relayd is not working under a non INET6 kernel

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

PATCH: relayd is not working under a non INET6 kernel

Julien Dhaille
Hi.
With a non INET6 kernel, relayd is not working :
fatal: icmp_init: socket: Protocol not supported.

Cheers

Index: check_icmp.c
===================================================================
RCS file: /cvs/src/usr.sbin/relayd/check_icmp.c,v
retrieving revision 1.34
diff -u -r1.34 check_icmp.c
--- check_icmp.c 17 Jan 2013 20:34:18 -0000 1.34
+++ check_icmp.c 28 Jan 2013 13:36:19 -0000
@@ -69,8 +69,11 @@
 {
  icmp_setup(env, &env->sc_icmp_send, AF_INET);
  icmp_setup(env, &env->sc_icmp_recv, AF_INET);
+#ifdef INET6
  icmp_setup(env, &env->sc_icmp6_send, AF_INET6);
  icmp_setup(env, &env->sc_icmp6_recv, AF_INET6);
+#endif
+
  env->sc_id = getpid() & 0xffff;
 }

--
Julien Dhaille
Reply | Threaded
Open this post in threaded view
|

Re: PATCH: relayd is not working under a non INET6 kernel

Brad Smith-14
----- Original message -----
> Hi.
> With a non INET6 kernel, relayd is not working :
> fatal: icmp_init: socket: Protocol not supported.
>
> Cheers

I could be wrong but I don't believe there is a INET6 define in userland so this would just break relayd for people using v6.

> Index: check_icmp.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/relayd/check_icmp.c,v
> retrieving revision 1.34
> diff -u -r1.34 check_icmp.c
> --- check_icmp.c 17 Jan 2013 20:34:18 -0000 1.34
> +++ check_icmp.c 28 Jan 2013 13:36:19 -0000
> @@ -69,8 +69,11 @@
>   {
>     icmp_setup(env, &env->sc_icmp_send, AF_INET);
>     icmp_setup(env, &env->sc_icmp_recv, AF_INET);
> +#ifdef INET6
>     icmp_setup(env, &env->sc_icmp6_send, AF_INET6);
>     icmp_setup(env, &env->sc_icmp6_recv, AF_INET6);
> +#endif
> +
>     env->sc_id = getpid() & 0xffff;
>   }
>
> --
> Julien Dhaille
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply | Threaded
Open this post in threaded view
|

Re: PATCH: relayd is not working under a non INET6 kernel

Stuart Henderson
On 2013/01/29 05:40, Brad Smith wrote:
> ----- Original message -----
> > Hi.
> > With a non INET6 kernel, relayd is not working :
> > fatal: icmp_init: socket: Protocol not supported.
> >
> > Cheers
>
> I could be wrong but I don't believe there is a INET6 define in userland so this would just break relayd for people using v6.

I think you are correct, there are various CFLAGS+=-DINET6 in various userland Makefiles.

Reply | Threaded
Open this post in threaded view
|

Re: PATCH: relayd is not working under a non INET6 kernel

Julien Dhaille
Just tried with a GENERIC kernel, however it's still working.
So, if i follow you, this usage of INET6 define is definitely ugly ?


2013/1/29 Stuart Henderson <[hidden email]>

> On 2013/01/29 05:40, Brad Smith wrote:
> > ----- Original message -----
> > > Hi.
> > > With a non INET6 kernel, relayd is not working :
> > > fatal: icmp_init: socket: Protocol not supported.
> > >
> > > Cheers
> >
> > I could be wrong but I don't believe there is a INET6 define in userland
> so this would just break relayd for people using v6.
>
> I think you are correct, there are various CFLAGS+=-DINET6 in various
> userland Makefiles.
>



--
Julien Dhaille
Reply | Threaded
Open this post in threaded view
|

Re: PATCH: relayd is not working under a non INET6 kernel

Brad Smith-14
On Tue, Jan 29, 2013 at 03:44:02PM +0100, Julien Dhaille wrote:
> Just tried with a GENERIC kernel, however it's still working.
> So, if i follow you, this usage of INET6 define is definitely ugly ?
 
You're building a kernel without INET6 so obviously you're not
using IPv6. So unless you test with IPv6 and using the ICMP
checker then your testing is worthless. Yes, the diff is
wrong and breaks relayd functionality.

> 2013/1/29 Stuart Henderson <[hidden email]>
>
> > On 2013/01/29 05:40, Brad Smith wrote:
> > > ----- Original message -----
> > > > Hi.
> > > > With a non INET6 kernel, relayd is not working :
> > > > fatal: icmp_init: socket: Protocol not supported.
> > > >
> > > > Cheers
> > >
> > > I could be wrong but I don't believe there is a INET6 define in userland
> > so this would just break relayd for people using v6.
> >
> > I think you are correct, there are various CFLAGS+=-DINET6 in various
> > userland Makefiles.
> >
>
>
>
> --
> Julien Dhaille
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply | Threaded
Open this post in threaded view
|

Re: PATCH: relayd is not working under a non INET6 kernel

Stuart Henderson
In reply to this post by Julien Dhaille
On 2013/01/29 15:44, Julien Dhaille wrote:
> Just tried with a GENERIC kernel, however it's still working.
> So, if i follow you, this usage of INET6 define is definitely ugly ?

Actually...it is irrelevant whether the kernel has v6 support or
not when you build this userland program, the same binary ought to
be able to cope with either type of kernel...

So it would probably be necessary to make the socket() failure be
a non-fatal error providing that both sockets (send/recv) for a
particular af did succeed. But then you need to prevent trying to
check_icmp_add when the socket couldn't be setup, and maybe even
push it back to where the host is added, bearing in mind that
someone might add an IPv6 host and reload the config expecting
it to not blow up.

Makes you wonder if it's really worth running a custom crippled
kernel in the first place :)

Reply | Threaded
Open this post in threaded view
|

Re: PATCH: relayd is not working under a non INET6 kernel

Claudio Jeker
In reply to this post by Julien Dhaille
On Tue, Jan 29, 2013 at 11:09:49AM +0100, Julien Dhaille wrote:

> Hi.
> With a non INET6 kernel, relayd is not working :
> fatal: icmp_init: socket: Protocol not supported.
>
> Cheers
>
> Index: check_icmp.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/relayd/check_icmp.c,v
> retrieving revision 1.34
> diff -u -r1.34 check_icmp.c
> --- check_icmp.c 17 Jan 2013 20:34:18 -0000 1.34
> +++ check_icmp.c 28 Jan 2013 13:36:19 -0000
> @@ -69,8 +69,11 @@
>  {
>   icmp_setup(env, &env->sc_icmp_send, AF_INET);
>   icmp_setup(env, &env->sc_icmp_recv, AF_INET);
> +#ifdef INET6
>   icmp_setup(env, &env->sc_icmp6_send, AF_INET6);
>   icmp_setup(env, &env->sc_icmp6_recv, AF_INET6);
> +#endif
> +

The proper fix would be to fix icmp_setup to not error out when
EPROTONOSUPPORT is returned.

>   env->sc_id = getpid() & 0xffff;
>  }
>
> --
> Julien Dhaille

--
:wq Claudio