| 961 | } |
| 962 | |
| 963 | static void |
| 964 | bridge_set_ifcap(struct bridge_softc *sc, struct bridge_iflist *bif, int set) |
| 965 | { |
| 966 | struct ifnet *ifp = bif->bif_ifp; |
| 967 | struct ifreq ifr; |
| 968 | int error, mask, stuck; |
| 969 | |
| 970 | bzero(&ifr, sizeof(ifr)); |
| 971 | ifr.ifr_reqcap = set; |
| 972 | |
| 973 | if (ifp->if_capenable != set) { |
| 974 | error = (*ifp->if_ioctl)(ifp, SIOCSIFCAP, (caddr_t)&ifr); |
| 975 | if (error) |
| 976 | if_printf(sc->sc_ifp, |
| 977 | "error setting capabilities on %s: %d\n", |
| 978 | ifp->if_xname, error); |
| 979 | mask = BRIDGE_IFCAPS_MASK | BRIDGE_IFCAPS_STRIP; |
| 980 | stuck = ifp->if_capenable & mask & ~set; |
| 981 | if (stuck != 0) |
| 982 | if_printf(sc->sc_ifp, |
| 983 | "can't disable some capabilities on %s: 0x%x\n", |
| 984 | ifp->if_xname, stuck); |
| 985 | } |
| 986 | } |
| 987 | |
| 988 | /* |
| 989 | * bridge_lookup_member: |
no test coverage detected