Author: glebius
Date: Mon Jan 13 21:12:10 2020
New Revision: 356702
URL: https://svnweb.freebsd.org/changeset/base/356702

Log:
  Fix yet another regression from r354484. Error code from cr_cansee()
  aliases with hard error from other operations.
  
  Reported by:  flo

Modified:
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_subr.c
==============================================================================
--- head/sys/netinet/tcp_subr.c Mon Jan 13 20:31:10 2020        (r356701)
+++ head/sys/netinet/tcp_subr.c Mon Jan 13 21:12:10 2020        (r356702)
@@ -2263,6 +2263,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
            inp = CK_LIST_NEXT(inp, inp_list)) {
                INP_RLOCK(inp);
                if (inp->inp_gencnt <= xig.xig_gen) {
+                       int crerr;
+
                        /*
                         * XXX: This use of cr_cansee(), introduced with
                         * TCP state changes, is not quite right, but for
@@ -2270,13 +2272,13 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
                         */
                        if (inp->inp_flags & INP_TIMEWAIT) {
                                if (intotw(inp) != NULL)
-                                       error = cr_cansee(req->td->td_ucred,
+                                       crerr = cr_cansee(req->td->td_ucred,
                                            intotw(inp)->tw_cred);
                                else
-                                       error = EINVAL; /* Skip this inp. */
+                                       crerr = EINVAL; /* Skip this inp. */
                        } else
-                               error = cr_canseeinpcb(req->td->td_ucred, inp);
-                       if (error == 0) {
+                               crerr = cr_canseeinpcb(req->td->td_ucred, inp);
+                       if (crerr == 0) {
                                struct xtcpcb xt;
 
                                tcp_inptoxtp(inp, &xt);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to