On 26.03.2015 22:42, Andrey V. Elsukov wrote:
>> If lp_detaching is non 0, the mbuf pointer is set to NULL without m_freem it.
>>
>> Can you look at this ?
> 
> Hi,
> 
> what you thing about this patch?
> lp_detaching can be non zero in case of parent interface departure.
> So I don't see the reason to call ETHER_BPF_MTAP() in this case.

Now I see the reason - to capture all received packets before interface
departure. New is attached.

-- 
WBR, Andrey V. Elsukov
Index: if_lagg.c
===================================================================
--- if_lagg.c	(revision 280234)
+++ if_lagg.c	(working copy)
@@ -1669,7 +1669,11 @@ lagg_input(struct ifnet *ifp, struct mbuf *m)
 
 	ETHER_BPF_MTAP(scifp, m);
 
-	m = (lp->lp_detaching == 0) ? lagg_proto_input(sc, lp, m) : NULL;
+	if (lp->lp_detaching != 0) {
+		m_freem(m);
+		m = NULL;
+	} else
+		m = lagg_proto_input(sc, lp, m);
 
 	if (m != NULL) {
 		if (scifp->if_flags & IFF_MONITOR) {

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to