Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/opencrypto Try to load swcrypto if we we did not find an...



details:   https://anonhg.NetBSD.org/src/rev/ab3a586f7730
branches:  trunk
changeset: 451962:ab3a586f7730
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 13 02:07:31 2019 +0000

description:
Try to load swcrypto if we we did not find any software drivers.

diffstat:

 sys/opencrypto/crypto.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r 539f5ded55bd -r ab3a586f7730 sys/opencrypto/crypto.c
--- a/sys/opencrypto/crypto.c   Thu Jun 13 02:02:45 2019 +0000
+++ b/sys/opencrypto/crypto.c   Thu Jun 13 02:07:31 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crypto.c,v 1.106 2018/06/06 01:49:09 maya Exp $ */
+/*     $NetBSD: crypto.c,v 1.107 2019/06/13 02:07:31 christos Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $   */
 /*     $OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $ */
 
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.106 2018/06/06 01:49:09 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.107 2019/06/13 02:07:31 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/reboot.h>
@@ -746,6 +746,7 @@
        u_int32_t hid;
        int accept;
        struct cryptocap *cap, *best;
+       int error = 0;
 
        best = NULL;
        /*
@@ -810,6 +811,14 @@
                goto again;
        }
 
+       if (best == NULL && hard == 0 && error == 0) {
+               error = module_autoload("swcrypto", MODULE_CLASS_DRIVER);
+               if (error == 0) {
+                       error = EINVAL;
+                       goto again;
+               }
+       }
+
        return best;
 }
 



Home | Main Index | Thread Index | Old Index