restrict carp use to ethernet interfaces

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

restrict carp use to ethernet interfaces

David Gwynne-5
carp interfaces output using ether_output, so it is reasonable to
require that they only get configured on top of ethernet interfaces
rather than just !IFT_CARP.

there's some more simplification that can occur after this is done.

ok?

Index: ip_carp.c
===================================================================
RCS file: /cvs/src/sys/netinet/ip_carp.c,v
retrieving revision 1.324
diff -u -p -r1.324 ip_carp.c
--- ip_carp.c 11 Jan 2018 00:14:15 -0000 1.324
+++ ip_carp.c 11 Jan 2018 00:26:52 -0000
@@ -1001,7 +1001,7 @@ carp_send_ad_all(void)
  return;
  ++carp_send_all_recur;
  TAILQ_FOREACH(ifp0, &ifnet, if_list) {
- if (ifp0->if_type == IFT_CARP)
+ if (ifp0->if_type != IFT_ETHER)
  continue;
 
  cif = &ifp0->if_carp;
@@ -1347,7 +1347,7 @@ carp_ourether(struct ifnet *ifp, u_int8_
  struct carp_softc *vh;
 
  KERNEL_ASSERT_LOCKED(); /* touching if_carp + carp_vhosts */
- KASSERT(ifp->if_type != IFT_CARP);
+ KASSERT(ifp->if_type == IFT_ETHER);
  cif = &ifp->if_carp;
 
  SRPL_FOREACH_LOCKED(vh, cif, sc_list) {
@@ -1694,7 +1694,7 @@ carp_set_ifp(struct carp_softc *sc, stru
  if ((ifp0->if_flags & IFF_MULTICAST) == 0)
  return (EADDRNOTAVAIL);
 
- if (ifp0->if_type == IFT_CARP)
+ if (ifp0->if_type != IFT_ETHER)
  return (EINVAL);
 
  cif = &ifp0->if_carp;
@@ -2469,7 +2469,7 @@ carp_carpdev_state(void *v)
  struct carp_softc *sc;
  struct ifnet *ifp0 = v;
 
- if (ifp0->if_type == IFT_CARP)
+ if (ifp0->if_type != IFT_ETHER)
  return;
 
  cif = &ifp0->if_carp;

Reply | Threaded
Open this post in threaded view
|

Re: restrict carp use to ethernet interfaces

Matthieu Herrb-7
On Thu, Jan 11, 2018 at 10:29:17AM +1000, David Gwynne wrote:
> carp interfaces output using ether_output, so it is reasonable to
> require that they only get configured on top of ethernet interfaces
> rather than just !IFT_CARP.
>
Hi,

in this context are vlan interfaces also considered as IFT_ETHER ?
I've use cases for carp over vlan interfaces. I'd hate not being able
to do that anymore.
--
Matthieu Herrb

Reply | Threaded
Open this post in threaded view
|

Re: restrict carp use to ethernet interfaces

Mischa Peters

> On 11 Jan 2018, at 08:25, Matthieu Herrb <[hidden email]> wrote:
>
>> On Thu, Jan 11, 2018 at 10:29:17AM +1000, David Gwynne wrote:
>> carp interfaces output using ether_output, so it is reasonable to
>> require that they only get configured on top of ethernet interfaces
>> rather than just !IFT_CARP.
>>
> Hi,
>
> in this context are vlan interfaces also considered as IFT_ETHER ?
> I've use cases for carp over vlan interfaces. I'd hate not being able
> to do that anymore.

Doing the same at the moment. Super useful to be able to continue to do this.

Mischa


Reply | Threaded
Open this post in threaded view
|

Re: restrict carp use to ethernet interfaces

Jonathan Gray-11
In reply to this post by Matthieu Herrb-7
On Thu, Jan 11, 2018 at 08:25:26AM +0100, Matthieu Herrb wrote:

> On Thu, Jan 11, 2018 at 10:29:17AM +1000, David Gwynne wrote:
> > carp interfaces output using ether_output, so it is reasonable to
> > require that they only get configured on top of ethernet interfaces
> > rather than just !IFT_CARP.
> >
> Hi,
>
> in this context are vlan interfaces also considered as IFT_ETHER ?
> I've use cases for carp over vlan interfaces. I'd hate not being able
> to do that anymore.
> --
> Matthieu Herrb
>

vlan(4) calls ether_ifattach() which sets ifp->if_type = IFT_ETHER

Reply | Threaded
Open this post in threaded view
|

Re: restrict carp use to ethernet interfaces

David Gwynne-5


> On 11 Jan 2018, at 5:53 pm, Jonathan Gray <[hidden email]> wrote:
>
> On Thu, Jan 11, 2018 at 08:25:26AM +0100, Matthieu Herrb wrote:
>> On Thu, Jan 11, 2018 at 10:29:17AM +1000, David Gwynne wrote:
>>> carp interfaces output using ether_output, so it is reasonable to
>>> require that they only get configured on top of ethernet interfaces
>>> rather than just !IFT_CARP.
>>>
>> Hi,
>>
>> in this context are vlan interfaces also considered as IFT_ETHER ?
>> I've use cases for carp over vlan interfaces. I'd hate not being able
>> to do that anymore.
>> --
>> Matthieu Herrb
>>
>
> vlan(4) calls ether_ifattach() which sets ifp->if_type = IFT_ETHER

yes.

vlan and trunk are definitely ethernet interfaces.

Reply | Threaded
Open this post in threaded view
|

Re: restrict carp use to ethernet interfaces

Peter Hessler
On 2018 Jan 11 (Thu) at 20:41:19 +1000 (+1000), David Gwynne wrote:
:vlan and trunk are definitely ethernet interfaces.
:

Is there anything in OpenBSD that isn't an ethernet inteface?


--
It is impossible to travel faster than light, and certainly not
desirable, as one's hat keeps blowing off.
                -- Woody Allen

Reply | Threaded
Open this post in threaded view
|

Re: restrict carp use to ethernet interfaces

David Gwynne-5


> On 11 Jan 2018, at 8:51 pm, Peter Hessler <[hidden email]> wrote:
>
> On 2018 Jan 11 (Thu) at 20:41:19 +1000 (+1000), David Gwynne wrote:
> :vlan and trunk are definitely ethernet interfaces.
> :
>
> Is there anything in OpenBSD that isn't an ethernet inteface?

carp :)

>
> --
> It is impossible to travel faster than light, and certainly not
> desirable, as one's hat keeps blowing off.
> -- Woody Allen
>

Reply | Threaded
Open this post in threaded view
|

Re: restrict carp use to ethernet interfaces

Peter Hessler
In reply to this post by Peter Hessler
On 2018 Jan 11 (Thu) at 11:51:25 +0100 (+0100), Peter Hessler wrote:
:On 2018 Jan 11 (Thu) at 20:41:19 +1000 (+1000), David Gwynne wrote:
::vlan and trunk are definitely ethernet interfaces.
::
:
:Is there anything in OpenBSD that isn't an ethernet inteface?
:

based on a simplistic grep:  upl(4), umb(4), bridge(4), enc(4), gre(4),
lo(4), mpe(4), pflog(4), pflow(4), pfsync(4), ppp/pppoe/pppx/sppp,
trunk(4), tun(4), switch(4), mpw(4), and of course, carp(4).

--
Pity the meek, for they shall inherit the earth.
                -- Don Marquis

Reply | Threaded
Open this post in threaded view
|

Re: restrict carp use to ethernet interfaces

Claudio Jeker
In reply to this post by Peter Hessler
On Thu, Jan 11, 2018 at 11:51:25AM +0100, Peter Hessler wrote:
> On 2018 Jan 11 (Thu) at 20:41:19 +1000 (+1000), David Gwynne wrote:
> :vlan and trunk are definitely ethernet interfaces.
> :
>
> Is there anything in OpenBSD that isn't an ethernet inteface?
>

How about gif(4), gre(4), tun(4), ppp(4), pppoe(4), mpe(4) and lo(4)?

--
:wq Claudio