]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/multilink.c
Remove the requirement that redistributions in binary form reproduce
[ppp.git] / pppd / multilink.c
index cb6bd106d1061e72d081741cfc4c134a06200df6..dd6d23f699496420221230d49e3d63c0354c4733 100644 (file)
@@ -1,17 +1,31 @@
 /*
  * multilink.c - support routines for multilink.
  *
- * Copyright (c) 2000 Paul Mackerras.
- * All rights reserved.
+ * Copyright (c) 2000-2002 Paul Mackerras. All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms.  The name of the author may not be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. The name(s) of the authors of this software must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission.
+ *
+ * 3. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Paul Mackerras
+ *     <paulus@samba.org>".
+ *
+ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 #include <string.h>
 #include <ctype.h>
@@ -71,9 +85,6 @@ mp_check_options()
        if (!wo->neg_endpoint && !noendpoint) {
                /* get a default endpoint value */
                wo->neg_endpoint = get_default_epdisc(&wo->endpoint);
-               if (wo->neg_endpoint)
-                       dbglog("using default endpoint %s",
-                              epdisc_to_str(&wo->endpoint));
        }
 }
 
@@ -86,8 +97,9 @@ mp_join_bundle()
 {
        lcp_options *go = &lcp_gotoptions[0];
        lcp_options *ho = &lcp_hisoptions[0];
+       lcp_options *ao = &lcp_allowoptions[0];
        int unit, pppd_pid;
-       int l;
+       int l, mtu;
        char *p;
        TDB_DATA key, pid, rec;
 
@@ -95,13 +107,18 @@ mp_join_bundle()
                /* not doing multilink */
                if (go->neg_mrru)
                        notice("oops, multilink negotiated only for receive");
+               mtu = ho->neg_mru? ho->mru: PPP_MRU;
+               if (mtu > ao->mru)
+                       mtu = ao->mru;
                if (demand) {
                        /* already have a bundle */
                        cfg_bundle(0, 0, 0, 0);
+                       netif_set_mtu(0, mtu);
                        return 0;
                }
                make_new_bundle(0, 0, 0, 0);
                set_ifunit(1);
+               netif_set_mtu(0, mtu);
                return 0;
        }
 
@@ -134,8 +151,10 @@ mp_join_bundle()
         * For demand mode, we only need to configure the bundle
         * and attach the link.
         */
+       mtu = MIN(ho->mrru, ao->mru);
        if (demand) {
                cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf);
+               netif_set_mtu(0, mtu);
                script_setenv("BUNDLE", bundle_id + 7, 1);
                return 0;
        }
@@ -179,6 +198,7 @@ mp_join_bundle()
        /* we have to make a new bundle */
        make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf);
        set_ifunit(1);
+       netif_set_mtu(0, mtu);
        script_setenv("BUNDLE", bundle_id + 7, 1);
        tdb_writeunlock(pppdb);
        info("New bundle %s created", ifname);