mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
Remove a workaround from previos revision. It proved to be incorrect.
Add two another workarounds for carp(4) interfaces: - do not add connected route when address is assigned to carp(4) interface - do not add connected route when other interface goes down Embrace workarounds with #ifdef DEV_CARP
This commit is contained in:
parent
ac5f2dab74
commit
50bb170471
1 changed files with 16 additions and 7 deletions
|
|
@ -31,6 +31,8 @@
|
|||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include "opt_carp.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sockio.h>
|
||||
|
|
@ -722,6 +724,13 @@ in_ifinit(ifp, ia, sin, scrub)
|
|||
ia->ia_net = i & ia->ia_netmask;
|
||||
ia->ia_subnet = i & ia->ia_subnetmask;
|
||||
in_socktrim(&ia->ia_sockmask);
|
||||
#ifdef DEV_CARP
|
||||
/*
|
||||
* XXX: carp(4) does not have interface route
|
||||
*/
|
||||
if (ifp->if_type == IFT_CARP)
|
||||
return (0);
|
||||
#endif
|
||||
/*
|
||||
* Add route for the network.
|
||||
*/
|
||||
|
|
@ -739,12 +748,6 @@ in_ifinit(ifp, ia, sin, scrub)
|
|||
return (0);
|
||||
flags |= RTF_HOST;
|
||||
}
|
||||
/*
|
||||
* XXX: A route to network should never point to a carp(4)
|
||||
* interface. Use only host route for CARP address.
|
||||
*/
|
||||
if (ifp->if_type == IFT_CARP)
|
||||
flags |= RTF_HOST;
|
||||
if ((error = in_addprefix(ia, flags)) != 0)
|
||||
return (error);
|
||||
|
||||
|
|
@ -852,8 +855,14 @@ in_scrubprefix(target)
|
|||
* If we got a matching prefix address, move IFA_ROUTE and
|
||||
* the route itself to it. Make sure that routing daemons
|
||||
* get a heads-up.
|
||||
*
|
||||
* XXX: a special case for carp(4) interface
|
||||
*/
|
||||
if ((ia->ia_flags & IFA_ROUTE) == 0) {
|
||||
if ((ia->ia_flags & IFA_ROUTE) == 0
|
||||
#ifdef DEV_CARP
|
||||
&& (ia->ia_ifp->if_type != IFT_CARP)
|
||||
#endif
|
||||
) {
|
||||
rtinit(&(target->ia_ifa), (int)RTM_DELETE,
|
||||
rtinitflags(target));
|
||||
target->ia_flags &= ~IFA_ROUTE;
|
||||
|
|
|
|||
Loading…
Reference in a new issue