Lines 184-189
Link Here
|
184 |
uint32_t bif_addrmax; /* max # of addresses */ |
184 |
uint32_t bif_addrmax; /* max # of addresses */ |
185 |
uint32_t bif_addrcnt; /* cur. # of addresses */ |
185 |
uint32_t bif_addrcnt; /* cur. # of addresses */ |
186 |
uint32_t bif_addrexceeded;/* # of address violations */ |
186 |
uint32_t bif_addrexceeded;/* # of address violations */ |
|
|
187 |
uint16_t bif_groupnum; /* group member number */ |
187 |
}; |
188 |
}; |
188 |
|
189 |
|
189 |
/* |
190 |
/* |
Lines 324-329
Link Here
|
324 |
static int bridge_ioctl_gifsstp(struct bridge_softc *, void *); |
325 |
static int bridge_ioctl_gifsstp(struct bridge_softc *, void *); |
325 |
static int bridge_ioctl_sproto(struct bridge_softc *, void *); |
326 |
static int bridge_ioctl_sproto(struct bridge_softc *, void *); |
326 |
static int bridge_ioctl_stxhc(struct bridge_softc *, void *); |
327 |
static int bridge_ioctl_stxhc(struct bridge_softc *, void *); |
|
|
328 |
static int bridge_ioctl_sifgroupnum(struct bridge_softc *, void *); |
329 |
|
327 |
static int bridge_pfil(struct mbuf **, struct ifnet *, struct ifnet *, |
330 |
static int bridge_pfil(struct mbuf **, struct ifnet *, struct ifnet *, |
328 |
int); |
331 |
int); |
329 |
static int bridge_ip_checkbasic(struct mbuf **mp); |
332 |
static int bridge_ip_checkbasic(struct mbuf **mp); |
Lines 482-487
Link Here
|
482 |
{ bridge_ioctl_sifmaxaddr, sizeof(struct ifbreq), |
485 |
{ bridge_ioctl_sifmaxaddr, sizeof(struct ifbreq), |
483 |
BC_F_COPYIN|BC_F_SUSER }, |
486 |
BC_F_COPYIN|BC_F_SUSER }, |
484 |
|
487 |
|
|
|
488 |
{ bridge_ioctl_sifgroupnum, sizeof(struct ifbreq), |
489 |
BC_F_COPYIN|BC_F_SUSER }, |
490 |
|
485 |
}; |
491 |
}; |
486 |
const int bridge_control_table_size = |
492 |
const int bridge_control_table_size = |
487 |
sizeof(bridge_control_table) / sizeof(bridge_control_table[0]); |
493 |
sizeof(bridge_control_table) / sizeof(bridge_control_table[0]); |
Lines 1193-1198
Link Here
|
1193 |
req->ifbr_priority = bp->bp_priority; |
1199 |
req->ifbr_priority = bp->bp_priority; |
1194 |
req->ifbr_path_cost = bp->bp_path_cost; |
1200 |
req->ifbr_path_cost = bp->bp_path_cost; |
1195 |
req->ifbr_portno = bif->bif_ifp->if_index & 0xfff; |
1201 |
req->ifbr_portno = bif->bif_ifp->if_index & 0xfff; |
|
|
1202 |
req->ifbr_groupnum = bif->bif_groupnum; |
1196 |
req->ifbr_proto = bp->bp_protover; |
1203 |
req->ifbr_proto = bp->bp_protover; |
1197 |
req->ifbr_role = bp->bp_role; |
1204 |
req->ifbr_role = bp->bp_role; |
1198 |
req->ifbr_stpflags = bp->bp_flags; |
1205 |
req->ifbr_stpflags = bp->bp_flags; |
Lines 1327-1332
Link Here
|
1327 |
strlcpy(breq.ifbr_ifsname, bif->bif_ifp->if_xname, |
1334 |
strlcpy(breq.ifbr_ifsname, bif->bif_ifp->if_xname, |
1328 |
sizeof(breq.ifbr_ifsname)); |
1335 |
sizeof(breq.ifbr_ifsname)); |
1329 |
breq.ifbr_ifsflags = bif->bif_flags; |
1336 |
breq.ifbr_ifsflags = bif->bif_flags; |
|
|
1337 |
breq.ifbr_groupnum = bif->bif_groupnum; |
1330 |
breq.ifbr_portno = bif->bif_ifp->if_index & 0xfff; |
1338 |
breq.ifbr_portno = bif->bif_ifp->if_index & 0xfff; |
1331 |
memcpy(buf, &breq, sizeof(breq)); |
1339 |
memcpy(buf, &breq, sizeof(breq)); |
1332 |
count++; |
1340 |
count++; |
Lines 1546-1551
Link Here
|
1546 |
} |
1554 |
} |
1547 |
|
1555 |
|
1548 |
static int |
1556 |
static int |
|
|
1557 |
bridge_ioctl_sifgroupnum(struct bridge_softc *sc, void *arg) |
1558 |
{ |
1559 |
struct ifbreq *req = arg; |
1560 |
struct bridge_iflist *bif; |
1561 |
|
1562 |
bif = bridge_lookup_member(sc, req->ifbr_ifsname); |
1563 |
if (bif == NULL) |
1564 |
return (ENOENT); |
1565 |
|
1566 |
bif->bif_groupnum = req->ifbr_groupnum; |
1567 |
return 0; |
1568 |
} |
1569 |
|
1570 |
static int |
1549 |
bridge_ioctl_sifmaxaddr(struct bridge_softc *sc, void *arg) |
1571 |
bridge_ioctl_sifmaxaddr(struct bridge_softc *sc, void *arg) |
1550 |
{ |
1572 |
{ |
1551 |
struct ifbreq *req = arg; |
1573 |
struct ifbreq *req = arg; |
Lines 2192-2198
Link Here
|
2192 |
|
2214 |
|
2193 |
/* Private segments can not talk to each other */ |
2215 |
/* Private segments can not talk to each other */ |
2194 |
if (sbif->bif_flags & dbif->bif_flags & IFBIF_PRIVATE) |
2216 |
if (sbif->bif_flags & dbif->bif_flags & IFBIF_PRIVATE) |
2195 |
goto drop; |
2217 |
{ |
|
|
2218 |
/* if the segment doesn't belong to a group, or the groups aren't the same */ |
2219 |
if (sbif->bif_groupnum == 0 || dbif->bif_groupnum == 0 || (sbif->bif_groupnum != dbif->bif_groupnum)) |
2220 |
goto drop; |
2221 |
} |
2196 |
|
2222 |
|
2197 |
if ((dbif->bif_flags & IFBIF_STP) && |
2223 |
if ((dbif->bif_flags & IFBIF_STP) && |
2198 |
dbif->bif_stp.bp_state == BSTP_IFSTATE_DISCARDING) |
2224 |
dbif->bif_stp.bp_state == BSTP_IFSTATE_DISCARDING) |
Lines 2465-2471
Link Here
|
2465 |
|
2491 |
|
2466 |
/* Private segments can not talk to each other */ |
2492 |
/* Private segments can not talk to each other */ |
2467 |
if (sbif && (sbif->bif_flags & dbif->bif_flags & IFBIF_PRIVATE)) |
2493 |
if (sbif && (sbif->bif_flags & dbif->bif_flags & IFBIF_PRIVATE)) |
2468 |
continue; |
2494 |
{ |
|
|
2495 |
/* if the segment doesn't belong to a group, or the groups aren't the same */ |
2496 |
if (sbif->bif_groupnum == 0 || dbif->bif_groupnum == 0 || (sbif->bif_groupnum != dbif->bif_groupnum)) |
2497 |
continue; |
2498 |
} |
2469 |
|
2499 |
|
2470 |
if ((dbif->bif_flags & IFBIF_STP) && |
2500 |
if ((dbif->bif_flags & IFBIF_STP) && |
2471 |
dbif->bif_stp.bp_state == BSTP_IFSTATE_DISCARDING) |
2501 |
dbif->bif_stp.bp_state == BSTP_IFSTATE_DISCARDING) |