* bridge_mutecaps: * * Clear or restore unwanted capabilities on the member interface */
| 935 | * Clear or restore unwanted capabilities on the member interface |
| 936 | */ |
| 937 | static void |
| 938 | bridge_mutecaps(struct bridge_softc *sc) |
| 939 | { |
| 940 | struct bridge_iflist *bif; |
| 941 | int enabled, mask; |
| 942 | |
| 943 | BRIDGE_LOCK_ASSERT(sc); |
| 944 | |
| 945 | /* Initial bitmask of capabilities to test */ |
| 946 | mask = BRIDGE_IFCAPS_MASK; |
| 947 | |
| 948 | CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { |
| 949 | /* Every member must support it or its disabled */ |
| 950 | mask &= bif->bif_savedcaps; |
| 951 | } |
| 952 | |
| 953 | CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { |
| 954 | enabled = bif->bif_ifp->if_capenable; |
| 955 | enabled &= ~BRIDGE_IFCAPS_STRIP; |
| 956 | /* strip off mask bits and enable them again if allowed */ |
| 957 | enabled &= ~BRIDGE_IFCAPS_MASK; |
| 958 | enabled |= mask; |
| 959 | bridge_set_ifcap(sc, bif, enabled); |
| 960 | } |
| 961 | } |
| 962 | |
| 963 | static void |
| 964 | bridge_set_ifcap(struct bridge_softc *sc, struct bridge_iflist *bif, int set) |
no test coverage detected