MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bridge_ioctl_sifflags

Function bridge_ioctl_sifflags

freebsd/net/if_bridge.c:1326–1364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1324}
1325
1326static int
1327bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg)
1328{
1329 struct ifbreq *req = arg;
1330 struct bridge_iflist *bif;
1331 struct bstp_port *bp;
1332 int error;
1333
1334 bif = bridge_lookup_member(sc, req->ifbr_ifsname);
1335 if (bif == NULL)
1336 return (ENOENT);
1337 bp = &bif->bif_stp;
1338
1339 if (req->ifbr_ifsflags & IFBIF_SPAN)
1340 /* SPAN is readonly */
1341 return (EINVAL);
1342
1343 if (req->ifbr_ifsflags & IFBIF_STP) {
1344 if ((bif->bif_flags & IFBIF_STP) == 0) {
1345 error = bstp_enable(&bif->bif_stp);
1346 if (error)
1347 return (error);
1348 }
1349 } else {
1350 if ((bif->bif_flags & IFBIF_STP) != 0)
1351 bstp_disable(&bif->bif_stp);
1352 }
1353
1354 /* Pass on STP flags */
1355 bstp_set_edge(bp, req->ifbr_ifsflags & IFBIF_BSTP_EDGE ? 1 : 0);
1356 bstp_set_autoedge(bp, req->ifbr_ifsflags & IFBIF_BSTP_AUTOEDGE ? 1 : 0);
1357 bstp_set_ptp(bp, req->ifbr_ifsflags & IFBIF_BSTP_PTP ? 1 : 0);
1358 bstp_set_autoptp(bp, req->ifbr_ifsflags & IFBIF_BSTP_AUTOPTP ? 1 : 0);
1359
1360 /* Save the bits relating to the bridge */
1361 bif->bif_flags = req->ifbr_ifsflags & IFBIFMASK;
1362
1363 return (0);
1364}
1365
1366static int
1367bridge_ioctl_scache(struct bridge_softc *sc, void *arg)

Callers

nothing calls this directly

Calls 7

bridge_lookup_memberFunction · 0.85
bstp_enableFunction · 0.85
bstp_disableFunction · 0.85
bstp_set_edgeFunction · 0.85
bstp_set_autoedgeFunction · 0.85
bstp_set_ptpFunction · 0.85
bstp_set_autoptpFunction · 0.85

Tested by

no test coverage detected