From 26b8066bce727ffbfc24b10f51022985a6442578 Mon Sep 17 00:00:00 2001 From: Pyun YongHyeon Date: Fri, 6 May 2011 20:37:07 +0000 Subject: [PATCH] Do not increment collision counter if transmit have failed. Transmission error in tun(4) is queueing error(i.e. ENOBUFS) and it has nothing to do with collision. Reported by: Zeus V Panchenko (zeus <> ibs dot dn dot ua) --- sys/net/if_tun.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 7c01ebe14cf6..f8349613faf5 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -661,10 +661,8 @@ tunoutput( } error = (ifp->if_transmit)(ifp, m0); - if (error) { - ifp->if_collisions++; + if (error) return (ENOBUFS); - } ifp->if_opackets++; return (0); }