diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2017-08-11 13:23:28 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2017-08-11 13:23:28 +0000 |
commit | 493139dc64f627eb96b6a9992352e6819979474c (patch) | |
tree | c243047768c94386af580360bbccb1a586e235a7 /sys | |
parent | bea1bdabb5a6cd0a8d1a6c3c2e3c7f6dc46ab929 (diff) |
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@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_spppsubr.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |