summaryrefslogtreecommitdiffstats
path: root/sys/net/if_vlan.c
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>2001-05-02 16:12:58 +0000
committerfenner <fenner@FreeBSD.org>2001-05-02 16:12:58 +0000
commit1501296e82bd1611cafb4dd5272e10cb2eb31fe0 (patch)
treef1df62c3d0a377be78fdf295b327c3a54bac0df6 /sys/net/if_vlan.c
parentdae4d9ed16230f273bcaebb7564fb64feb02f9a9 (diff)
downloadFreeBSD-src-1501296e82bd1611cafb4dd5272e10cb2eb31fe0.zip
FreeBSD-src-1501296e82bd1611cafb4dd5272e10cb2eb31fe0.tar.gz
Get IP multicast working on VLAN devices:
- Allocate zeroed memory in ether_resolvemulti() to prevent equal() from comparing garbage and determining that two otherwise-equal sockaddr_dls are different. - Fill in all required fields of the sockaddr_dl - Actually copy the multicast address into the sockaddr_dl when calling if_addmulti() - Don't claim that we don't have a way to resolve layer 3 addresses into layer 2 addresses; use the ethernet way.
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r--sys/net/if_vlan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 639a59c..e2b4545 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -123,6 +123,8 @@ vlan_setmulti(struct ifnet *ifp)
bzero((char *)&sdl, sizeof sdl);
sdl.sdl_len = sizeof sdl;
sdl.sdl_family = AF_LINK;
+ sdl.sdl_index = ifp_p->if_index;
+ sdl.sdl_type = IFT_ETHER;
sdl.sdl_alen = ETHER_ADDR_LEN;
/* First, remove any existing filter entries. */
@@ -144,6 +146,8 @@ vlan_setmulti(struct ifnet *ifp)
bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr),
(char *)&mc->mc_addr, ETHER_ADDR_LEN);
SLIST_INSERT_HEAD(&sc->vlan_mc_listhead, mc, mc_entries);
+ bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr),
+ LLADDR(&sdl), ETHER_ADDR_LEN);
error = if_addmulti(ifp_p, (struct sockaddr *)&sdl, &rifma);
if (error)
return(error);
@@ -177,7 +181,6 @@ vlaninit(void)
/* Now undo some of the damage... */
ifp->if_data.ifi_type = IFT_8021_VLAN;
ifp->if_data.ifi_hdrlen = EVL_ENCAPLEN;
- ifp->if_resolvemulti = 0;
}
}
OpenPOWER on IntegriCloud