diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-11-16 03:42:14 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-11-16 03:42:14 +0000 |
commit | 3ce6aa98bd5226402d9a5f5856e9794970ad7e90 (patch) | |
tree | f6fe4d0369a55b31e3e23404c75b9f302b35aa6a /sys/net | |
parent | 738c92a944f52fbe1a539630eedc27ce52ff7108 (diff) |
Make sure to increment the the output error counter if
not using TRUNK_PROTO_NONE and there are no member ports.
ok mpf@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_trunk.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c index 47c87a80d5d..f42bd810eb9 100644 --- a/sys/net/if_trunk.c +++ b/sys/net/if_trunk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.c,v 1.59 2008/11/08 01:00:01 mpf Exp $ */ +/* $OpenBSD: if_trunk.c,v 1.60 2008/11/16 03:42:13 brad Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org> @@ -946,15 +946,17 @@ trunk_start(struct ifnet *ifp) bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT); #endif - if (tr->tr_proto != TRUNK_PROTO_NONE && tr->tr_count) + if (tr->tr_proto != TRUNK_PROTO_NONE && tr->tr_count) { error = (*tr->tr_start)(tr, m); - else + if (error == 0) + ifp->if_opackets++; + else + ifp->if_oerrors++; + } else { m_freem(m); - - if (error == 0) - ifp->if_opackets++; - else - ifp->if_oerrors++; + if (tr->tr_proto != TRUNK_PROTO_NONE) + ifp->if_oerrors++; + } } } |