bridge interface type

hiren panchasara hiren.panchasara at gmail.com
Mon Mar 5 17:58:44 UTC 2012


On Sun, Mar 4, 2012 at 11:14 PM, Andrew Thompson <thompsa at freebsd.org>wrote:

> Here is a patch that changes it but I do not know what may break.
>
Thanks a lot Andrew. So, someone might be relying on interface type of
bridge being IFT_ETHER?
Who can confirm if this is a good patch?

>
> Index: if_bridge.c
> ===================================================================
> --- if_bridge.c (revision 232321)
> +++ if_bridge.c (working copy)
> @@ -568,6 +568,7 @@ bridge_clone_create(struct if_clone *ifc, int unit
>  {
>        struct bridge_softc *sc, *sc2;
>        struct ifnet *bifp, *ifp;
> +       struct sockaddr_dl *sdl;
>        int fb, retry;
>        unsigned long hostid;
>
> @@ -642,6 +643,8 @@ bridge_clone_create(struct if_clone *ifc, int unit
>        /* Now undo some of the damage... */
>        ifp->if_baudrate = 0;
>        ifp->if_type = IFT_BRIDGE;
> +       sdl = (struct sockaddr_dl *)ifp->if_addr->ifa_addr;
> +       sdl->sdl_type = IFT_BRIDGE;
>
>        mtx_lock(&bridge_list_mtx);
>        LIST_INSERT_HEAD(&bridge_list, sc, sc_list);
>

Appreciate your help,
Hiren


More information about the freebsd-net mailing list