Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/net Pull up revision 1.55 (requested by groo in tic...



details:   https://anonhg.NetBSD.org/src/rev/11947fd749e6
branches:  netbsd-1-6
changeset: 529006:11947fd749e6
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sat Aug 17 05:49:31 2002 +0000

description:
Pull up revision 1.55 (requested by groo in ticket #669):
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 df55769dceb2 -r 11947fd749e6 sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Sat Aug 17 05:36:00 2002 +0000
+++ b/sys/net/if_spppsubr.c     Sat Aug 17 05:49:31 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.46.4.3 2002/08/17 05:35:48 lukem Exp $        */
+/*     $NetBSD: if_spppsubr.c,v 1.46.4.4 2002/08/17 05:49:31 lukem Exp $        */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.46.4.3 2002/08/17 05:35:48 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.46.4.4 2002/08/17 05:49:31 lukem Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipx.h"
@@ -2265,8 +2265,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:
                        /*
@@ -5020,8 +5024,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)
@@ -5033,8 +5037,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)
@@ -5046,8 +5050,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)
@@ -5059,8 +5063,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)
@@ -5069,6 +5073,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