diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2017-08-14 08:33:56 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2017-08-14 08:33:56 +0000 |
commit | 1a84c4ca7ae7edb88e4a09c13b938cbc01125116 (patch) | |
tree | 0cc2fadf3455fec7ba8df25089dd846f501d5ff2 /sys/net | |
parent | 69d06aa84f4ab6b27dd0448bf0640684b7360edd (diff) |
Use the rv variable in sppp_output() as it was intended.
sppp_output has the following comment:
"Don't choke with an ENETDOWN early. It's possible that we just
started dialing out, so don't drop the packet immediately. If we
notice that we run out of buffer space below, we will however remember
that we are not ready to carry IPv6 packets, and return ENETDOWN, as
opposed to ENOBUFS."
A later revision of the code just returned ENOBUFS anyway, ignoring
the rv variable that might have ENETDOWN instead, turning rv into an
unused variable.
Coverity CID 1299246; Severity: Minor
OK sthen@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_spppsubr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 4b541535bda..599f9fcfc2d 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.170 2017/08/11 21:24:19 mpi Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.171 2017/08/14 08:33:55 reyk Exp $ */ /* * Synchronous PPP link level subroutines. * @@ -658,7 +658,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, SPP_ARGS(ifp)); ++ifp->if_oerrors; splx(s); - return (ENOBUFS); + return (rv ? rv : ENOBUFS); } *mtod(m, u_int16_t *) = protocol; |