On Tue, Jan 22, 2019 at 12:58:56PM -0200, Martin Pieuchot wrote:
> Directly pass a pointer, which implies we have a valid reference for
> the given interface. This will matters when we'll start using ifp
> indexes.
>
> ok?
OK claudio@
> Index: net/if_bridge.c
> ===================================================================
> RCS file: /cvs/src/sys/net/if_bridge.c,v
> retrieving revision 1.316
> diff -u -p -r1.316 if_bridge.c
> --- net/if_bridge.c 17 Jan 2019 16:07:42 -0000 1.316
> +++ net/if_bridge.c 22 Jan 2019 14:54:28 -0000
> @@ -1062,15 +1062,15 @@ bridgeintr_frame(struct bridge_softc *sc
> * Return 1 if `ena' belongs to `bif', 0 otherwise.
> */
> int
> -bridge_ourether(struct bridge_iflist *bif, uint8_t *ena)
> +bridge_ourether(struct ifnet *ifp, uint8_t *ena)
> {
> - struct arpcom *ac = (struct arpcom *)bif->ifp;
> + struct arpcom *ac = (struct arpcom *)ifp;
>
> if (memcmp(ac->ac_enaddr, ena, ETHER_ADDR_LEN) == 0)
> return (1);
>
> #if NCARP > 0
> - if (carp_ourether(bif->ifp, ena))
> + if (carp_ourether(ifp, ena))
> return (1);
> #endif
>
> @@ -1190,7 +1190,7 @@ bridge_process(struct ifnet *ifp, struct
> SLIST_FOREACH(bif, &sc->sc_iflist, bif_next) {
> if (bif->ifp->if_type != IFT_ETHER)
> continue;
> - if (bridge_ourether(bif, eh->ether_dhost)) {
> + if (bridge_ourether(bif->ifp, eh->ether_dhost)) {
> if (bif0->bif_flags & IFBIF_LEARNING)
> bridge_rtupdate(sc,
> (struct ether_addr *)&eh->ether_shost,
> @@ -1208,7 +1208,7 @@ bridge_process(struct ifnet *ifp, struct
> bridge_ifinput(bif->ifp, m);
> return;
> }
> - if (bridge_ourether(bif, eh->ether_shost)) {
> + if (bridge_ourether(bif->ifp, eh->ether_shost)) {
> m_freem(m);
> return;
> }
>
--
:wq Claudio