bridgeif: Remove redundant port_netif NULL test in bridgeif_send_to_port

portif = br->ports[dstport_idx].port_netif;
So no need to have NULL test for both br->ports[dstport_idx].port_netif
and portif.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
This commit is contained in:
Axel Lin 2017-11-24 09:06:32 +08:00 committed by Dirk Ziegelmeier
parent 2ceedfe097
commit 975e23bf5e

View File

@ -252,14 +252,12 @@ bridgeif_send_to_port(bridgeif_private_t *br, struct pbuf *p, u8_t dstport_idx)
/* possibly an external port */
if (dstport_idx < br->max_ports) {
struct netif *portif = br->ports[dstport_idx].port_netif;
if (br->ports[dstport_idx].port_netif != NULL) {
if ((portif != NULL) && (portif->linkoutput != NULL)) {
/* prevent sending out to rx port */
if (netif_get_index(portif) != p->if_idx) {
if (netif_is_link_up(portif)) {
LWIP_DEBUGF(BRIDGEIF_FW_DEBUG, ("br -> flood(%p:%d) -> %d\n", (void *)p, p->if_idx, netif_get_index(portif)));
return portif->linkoutput(portif, p);
}
if ((portif != NULL) && (portif->linkoutput != NULL)) {
/* prevent sending out to rx port */
if (netif_get_index(portif) != p->if_idx) {
if (netif_is_link_up(portif)) {
LWIP_DEBUGF(BRIDGEIF_FW_DEBUG, ("br -> flood(%p:%d) -> %d\n", (void *)p, p->if_idx, netif_get_index(portif)));
return portif->linkoutput(portif, p);
}
}
}