From 493139dc64f627eb96b6a9992352e6819979474c Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Fri, 11 Aug 2017 13:23:28 +0000 Subject: The timeval in sppp_input() is also used when the interface is not IFF_UP. Always call getmicrouptime(&tv) to avoid an "Uninitialized scalar variable". Coverity CID 1453266; Severity: Insignificant OK deraadt@ --- sys/net/if_spppsubr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/net') diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 6b3602b7a13..1c745073c65 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.166 2017/08/01 20:52:32 mpi Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.167 2017/08/11 13:23:27 reyk Exp $ */ /* * Synchronous PPP link level subroutines. * @@ -419,11 +419,12 @@ sppp_input(struct ifnet *ifp, struct mbuf *m) struct timeval tv; int debug = ifp->if_flags & IFF_DEBUG; + getmicrouptime(&tv); + if (ifp->if_flags & IFF_UP) { /* Count received bytes, add hardware framing */ ifp->if_ibytes += m->m_pkthdr.len + sp->pp_framebytes; /* Note time of last receive */ - getmicrouptime(&tv); sp->pp_last_receive = tv.tv_sec; } -- cgit v1.2.3