Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2007 10:02:54 +1300
From:      Andrew Thompson <thompsa@freebsd.org>
To:        Roman Kurakin <rik@inse.ru>
Cc:        rik@FreeBSD.org, andre@FreeBSD.org, freebsd-net@freebsd.org, bms@FreeBSD.org, glebius@FreeBSD.org
Subject:   Re: kern/109815: wrong interface identifier at pfil_hooks for vlans +	if_bridge
Message-ID:  <20070307210254.GD54828@heff.fud.org.nz>
In-Reply-To: <45EDA348.3030309@inse.ru>
References:  <E1HNbWw-000LoF-Bo@pobox.codelabs.ru> <45E9F1E8.2000802@inse.ru> <20070304062203.GL80319@codelabs.ru> <E1HNbWw-000LoF-Bo@pobox.codelabs.ru> <45E9F1E8.2000802@inse.ru> <20070304160613.GN80319@codelabs.ru> <45EDA348.3030309@inse.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 06, 2007 at 08:22:16PM +0300, Roman Kurakin wrote:
> Ok, since no one want to provide an explanation I'll to do it myself.
...
> I suggest to fix this problem in the other way, by checking if the 
> physical interface
> is the dst interface by MAC. Eq if we got packet from Ci, it will be 
> market as received
> from Ci, not from Cj. Yes it will add double checking for this interface 
> it is not the
> dst with some probability, but will optimize the case the dst is the 
> current one cause
> we will not check the list. This will keep the old behaviour eq case 1 
> and will do the
> same trick for cases like VLANs. Here my variant of the patch:

I think this is probably the best way to do it. I have only been loosely
following this thread due to other stuff going on.

> 
> +        /* Give a chance for ifp at first priority. This will help in case 
> we
> +         * the packet comes through the interface with VLAN's and the same
> +         * MACs on several interfaces in a bridge. Also will save some 
> circles
> +         * in case dst interface is the physical input interface (eq ifp).
> +         */
> +        if (ifp->if_type == IFT_GIF
               ^^^^^^^^^^^^^^^^^^^^^^^
	       is this check right?

> +            && (memcmp(IF_LLADDR(bif2->bif_ifp), eh->ether_dhost,
> +                ETHER_ADDR_LEN) == 0
> +#ifdef DEV_CARP
> +                || (bif2->bif_ifp->if_carp 
> +                    && carp_forus(bif2->bif_ifp->if_carp, eh->ether_dhost))
> +#endif
> +            )) {
> +                if (bif->bif_flags & IFBIF_LEARNING)
> +                        (void) bridge_rtupdate(sc,
> +                            eh->ether_shost, bif, 0, IFBAF_DYNAMIC);
> +                m->m_pkthdr.rcvif = ifp;
> +                BRIDGE_UNLOCK(sc);
> +                return (m);
> +        }

I will be keen to see your final patch.


Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070307210254.GD54828>