Source-Changes-HG archive

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

[src/trunk]: src/sys/net Define a few more LCP options. Recognize, sanity-che...



details:   https://anonhg.NetBSD.org/src/rev/1f557a90b20e
branches:  trunk
changeset: 1008732:1f557a90b20e
user:      is <is%NetBSD.org@localhost>
date:      Wed Apr 01 20:24:50 2020 +0000

description:
Define a few more LCP options. Recognize, sanity-check and report (but
still reject for the moment) multilink PPP configuration options received.

diffstat:

 sys/net/if_spppsubr.c |  47 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 45 insertions(+), 2 deletions(-)

diffs (82 lines):

diff -r 3dc7735b62ae -r 1f557a90b20e sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Wed Apr 01 18:34:22 2020 +0000
+++ b/sys/net/if_spppsubr.c     Wed Apr 01 20:24:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.187 2020/03/06 10:26:59 knakahara Exp $       */
+/*     $NetBSD: if_spppsubr.c,v 1.188 2020/04/01 20:24:50 is Exp $      */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.187 2020/03/06 10:26:59 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.188 2020/04/01 20:24:50 is Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -146,6 +146,13 @@
 #define LCP_OPT_RESERVED       6       /* reserved */
 #define LCP_OPT_PROTO_COMP     7       /* protocol field compression */
 #define LCP_OPT_ADDR_COMP      8       /* address/control field compression */
+#define LCP_OPT_FCS_ALTS       9       /* FCS alternatives */
+#define LCP_OPT_SELF_DESC_PAD  10      /* self-describing padding */
+#define LCP_OPT_CALL_BACK      13      /* callback */
+#define LCP_OPT_COMPOUND_FRMS  15      /* compound frames */
+#define LCP_OPT_MP_MRRU                17      /* multilink MRRU */
+#define LCP_OPT_MP_SSNHF       18      /* multilink short seq. numbers */
+#define LCP_OPT_MP_EID         19      /* multilink endpoint discriminator */
 
 #define IPCP_OPT_ADDRESSES     1       /* both IP addresses; deprecated */
 #define IPCP_OPT_COMPRESSION   2       /* IP compression protocol */
@@ -2374,6 +2381,36 @@
                        if (debug)
                                addlog(" [invalid]");
                        break;
+               case LCP_OPT_MP_EID:
+                       if (len >= l && l >= 3) {
+                               if (debug)
+                                       addlog(" [rej]");
+                               break;
+                       }
+                       if (debug)
+                               addlog(" [invalid]");
+                       break;
+               case LCP_OPT_MP_SSNHF:
+                       if (len >= 2 && l == 2) {
+                               if (debug)
+                                       addlog(" [rej]");
+                               break;
+                       }
+                       if (debug)
+                               addlog(" [invalid]");
+                       break;
+               case LCP_OPT_MP_MRRU:
+                       /* Multilink maximum received reconstructed unit */
+                       /* should be fall through, both are same length */
+                       /* for now, check, then reject anyway */
+                       if (len >= 4 && l == 4) {
+                               if (debug)
+                                       addlog(" %d [rej]", (p[2] <<8) + p[3]);
+                               break;
+                       }
+                       if (debug)
+                               addlog(" [invalid]");
+                       break;
                case LCP_OPT_MRU:
                        /* Maximum receive unit. */
                        if (len >= 4 && l == 4)
@@ -6016,6 +6053,12 @@
        case LCP_OPT_MAGIC:             return "magic";
        case LCP_OPT_PROTO_COMP:        return "proto-comp";
        case LCP_OPT_ADDR_COMP:         return "addr-comp";
+       case LCP_OPT_SELF_DESC_PAD:     return "sdpad";
+       case LCP_OPT_CALL_BACK:         return "callback";
+       case LCP_OPT_COMPOUND_FRMS:     return "cmpd-frms";
+       case LCP_OPT_MP_MRRU:           return "mrru";
+       case LCP_OPT_MP_SSNHF:          return "mp-ssnhf";
+       case LCP_OPT_MP_EID:            return "mp-eid";
        }
        snprintf(buf, sizeof(buf), "0x%x", opt);
        return buf;



Home | Main Index | Thread Index | Old Index