BSD 4_3_Net_2 release
[unix-history] / usr / src / sys / netiso / clnp_frag.c
index 6f2cc2a..6e5403b 100644 (file)
@@ -1,3 +1,38 @@
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * 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. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)clnp_frag.c 7.12 (Berkeley) 5/6/91
+ */
+
 /***********************************************************
                Copyright IBM Corporation 1987
 
 /***********************************************************
                Copyright IBM Corporation 1987
 
@@ -26,11 +61,6 @@ SOFTWARE.
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_frag.c,v 5.1 89/02/09 16:20:26 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_frag.c,v $ */
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_frag.c,v 5.1 89/02/09 16:20:26 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_frag.c,v $ */
-/*     @(#)clnp_frag.c 7.9 (Berkeley) 6/4/90 */
-
-#ifndef lint
-static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_frag.c,v 5.1 89/02/09 16:20:26 hagens Exp $";
-#endif lint
 
 #include "param.h"
 #include "mbuf.h"
 
 #include "param.h"
 #include "mbuf.h"
@@ -85,7 +115,7 @@ struct rtentry *rt;                  /* route if direct ether */
 {
        struct clnp_fixed               *clnp = mtod(m, struct clnp_fixed *);
        int                                             hdr_len = (int)clnp->cnf_hdr_len;
 {
        struct clnp_fixed               *clnp = mtod(m, struct clnp_fixed *);
        int                                             hdr_len = (int)clnp->cnf_hdr_len;
-       int                                             frag_size = (ifp->if_mtu - hdr_len) & ~7;
+       int                                             frag_size = (SN_MTU(ifp, rt) - hdr_len) & ~7;
 
        total_len -= hdr_len;
        if ((clnp->cnf_type & CNF_SEG_OK) &&
 
        total_len -= hdr_len;
        if ((clnp->cnf_type & CNF_SEG_OK) &&
@@ -96,7 +126,7 @@ struct rtentry *rt;                  /* route if direct ether */
                struct mbuf                     *frag_hdr = NULL;
                struct mbuf                     *frag_data = NULL;
                struct clnp_segment     seg_part;                       /* segmentation header */
                struct mbuf                     *frag_hdr = NULL;
                struct mbuf                     *frag_data = NULL;
                struct clnp_segment     seg_part;                       /* segmentation header */
-               int                                     frag_size, frag_base;
+               int                                     frag_base;
                int                                     error = 0;
 
 
                int                                     error = 0;