Source-Changes-HG archive

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

[src/trunk]: src/sys/net Patches from Frank Kardel:



details:   https://anonhg.NetBSD.org/src/rev/83ccc8f03f69
branches:  trunk
changeset: 534512:83ccc8f03f69
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jul 28 22:16:47 2002 +0000

description:
Patches from Frank Kardel:
- length was one off in names and secrets.
- add win 98 kludge but we keep it disabled for now.
- setup the authorization bit early so that we don't end up doing ppp
  negotiations without authorization.

diffstat:

 sys/net/if_spppsubr.c |  28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diffs (86 lines):

diff -r b097efb9ec90 -r 83ccc8f03f69 sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Sun Jul 28 21:46:34 2002 +0000
+++ b/sys/net/if_spppsubr.c     Sun Jul 28 22:16:47 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.54 2002/07/28 19:54:47 christos Exp $         */
+/*     $NetBSD: if_spppsubr.c,v 1.55 2002/07/28 22:16:47 christos Exp $         */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.54 2002/07/28 19:54:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.55 2002/07/28 22:16:47 christos Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipx.h"
@@ -2276,8 +2276,12 @@
                        if (debug)
                                addlog(" [non-empty]");
                        /* suggest a zero one */
+#ifndef BROKEN_98 /* XXX - broken Win98 drivers INSIST on having an ASYNC_MAP */
                        p[2] = p[3] = p[4] = p[5] = 0;
                        break;
+#else
+                       continue;
+#endif
 
                case LCP_OPT_MRU:
                        /*
@@ -5032,8 +5036,8 @@
                        sp->hisauth.name = NULL;
                        return error;
                    }
-                   sp->hisauth.name[cfg->hisname_length-1] = 0;
-                   sp->hisauth.name_len = cfg->hisname_length;
+                   sp->hisauth.name_len = cfg->hisname_length - 1;
+                   sp->hisauth.name[sp->hisauth.name_len] = 0;
                }
                if (cfg->hissecret != NULL && cfg->hissecret_length > 0) {
                    if (cfg->hissecret_length >= MCLBYTES)
@@ -5045,8 +5049,8 @@
                        sp->hisauth.secret = NULL;
                        return error;
                    }
-                   sp->hisauth.secret[cfg->hissecret_length-1] = 0;
-                   sp->hisauth.secret_len = cfg->hissecret_length;
+                   sp->hisauth.secret_len = cfg->hissecret_length - 1;
+                   sp->hisauth.secret[sp->hisauth.secret_len] = 0;
                }
                if (cfg->myname != NULL && cfg->myname_length > 0) {
                    if (cfg->myname_length >= MCLBYTES)
@@ -5058,8 +5062,8 @@
                        sp->myauth.name = NULL;
                        return error;
                    }
-                   sp->myauth.name[cfg->myname_length-1] = 0;
-                   sp->myauth.name_len = cfg->myname_length;
+                   sp->myauth.name_len = cfg->myname_length - 1;
+                   sp->myauth.name[sp->myauth.name_len] = 0;
                }
                if (cfg->mysecret != NULL && cfg->mysecret_length > 0) {
                    if (cfg->mysecret_length >= MCLBYTES)
@@ -5071,8 +5075,8 @@
                        sp->myauth.secret = NULL;
                        return error;
                    }
-                   sp->myauth.secret[cfg->mysecret_length-1] = 0;
-                   sp->myauth.secret_len = cfg->mysecret_length;
+                   sp->myauth.secret_len = cfg->mysecret_length - 1;
+                   sp->myauth.secret[sp->myauth.secret_len] = 0;
                }
                sp->myauth.flags = cfg->myauthflags;
                if (cfg->myauth)
@@ -5081,6 +5085,10 @@
                if (cfg->hisauth)
                    sp->hisauth.proto = (cfg->hisauth == SPPP_AUTHPROTO_PAP) ? PPP_PAP : PPP_CHAP;
                sp->pp_auth_failures = 0;
+               if (sp->hisauth.proto != 0) 
+                   sp->lcp.opts |= (1 << LCP_OPT_AUTH_PROTO);
+               else
+                   sp->lcp.opts &= ~(1 << LCP_OPT_AUTH_PROTO);
            }
            break;
        case SPPPGETLCPCFG:



Home | Main Index | Thread Index | Old Index