git: 44669b765049 - main - if_tuntap: remove redundant check

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Thu, 09 Nov 2023 14:49:30 UTC
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=44669b76504991ef3ac10ef10bc0fa931ae79c45

commit 44669b76504991ef3ac10ef10bc0fa931ae79c45
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2023-11-09 10:43:54 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2023-11-09 10:43:54 +0000

    if_tuntap: remove redundant check
    
    eh can't be NULL, so there is no need to check for it.
    Reported by:    zlei
    MFC after:      1 week
    Sponsored by:   Netflix, Inc.
---
 sys/net/if_tuntap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c
index 30d1d84b2f59..8881bbaec070 100644
--- a/sys/net/if_tuntap.c
+++ b/sys/net/if_tuntap.c
@@ -1779,7 +1779,7 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m,
 
 	eh = mtod(m, struct ether_header *);
 
-	if (eh && (ifp->if_flags & IFF_PROMISC) == 0 &&
+	if ((ifp->if_flags & IFF_PROMISC) == 0 &&
 	    !ETHER_IS_MULTICAST(eh->ether_dhost) &&
 	    bcmp(eh->ether_dhost, IF_LLADDR(ifp), ETHER_ADDR_LEN) != 0) {
 		m_freem(m);