BSD 4_3_Net_2 release
[unix-history] / usr / src / sys / netiso / clnp_output.c
index d8bd35e..30524e4 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_output.c       7.10 (Berkeley) 5/6/91
+ */
+
 /***********************************************************
                Copyright IBM Corporation 1987
 
 /***********************************************************
                Copyright IBM Corporation 1987
 
@@ -26,11 +61,6 @@ SOFTWARE.
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_output.c,v 5.0 89/02/08 12:00:15 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_output.c,v $ */
  */
 /* $Header: /var/src/sys/netiso/RCS/clnp_output.c,v 5.0 89/02/08 12:00:15 hagens Exp $ */
 /* $Source: /var/src/sys/netiso/RCS/clnp_output.c,v $ */
-/*     @(#)clnp_output.c       7.8 (Berkeley) 6/4/90 */
-
-#ifndef lint
-static char *rcsid = "$Header: /var/src/sys/netiso/RCS/clnp_output.c,v 5.0 89/02/08 12:00:15 hagens Exp $";
-#endif lint
 
 #include "param.h"
 #include "mbuf.h"
 
 #include "param.h"
 #include "mbuf.h"
@@ -373,6 +403,7 @@ int                                 flags;          /* flags */
                        goto bad;
                }
                clcp->clc_rt = isop->isop_route.ro_rt;  /* XXX */
                        goto bad;
                }
                clcp->clc_rt = isop->isop_route.ro_rt;  /* XXX */
+               clcp->clc_ifp = clcp->clc_ifa->ia_ifp;  /* XXX */
 
                IFDEBUG(D_OUTPUT)
                        printf("clnp_output: packet routed to %s\n", 
 
                IFDEBUG(D_OUTPUT)
                        printf("clnp_output: packet routed to %s\n", 
@@ -472,7 +503,7 @@ int                                 flags;          /* flags */
                (void) bcopy((caddr_t)&seg_part, (caddr_t) clnp + clcp->clc_segoff, 
                        sizeof(seg_part));
        }
                (void) bcopy((caddr_t)&seg_part, (caddr_t) clnp + clcp->clc_segoff, 
                        sizeof(seg_part));
        }
-       if (total_len <= SN_MTU(clcp->clc_ifa->ia_ifp)) {
+       if (total_len <= SN_MTU(clcp->clc_ifp, clcp->clc_rt)) {
                HTOC(clnp->cnf_seglen_msb, clnp->cnf_seglen_lsb, total_len);
                m->m_pkthdr.len = total_len;
                /*
                HTOC(clnp->cnf_seglen_msb, clnp->cnf_seglen_lsb, total_len);
                m->m_pkthdr.len = total_len;
                /*
@@ -499,7 +530,7 @@ int                                 flags;          /* flags */
                /*
                 * Too large for interface; fragment if possible.
                 */
                /*
                 * Too large for interface; fragment if possible.
                 */
-               error = clnp_fragment(clcp->clc_ifa->ia_ifp, m, clcp->clc_firsthop,
+               error = clnp_fragment(clcp->clc_ifp, m, clcp->clc_firsthop,
                                                        total_len, clcp->clc_segoff, flags, clcp->clc_rt);
                goto done;
        }
                                                        total_len, clcp->clc_segoff, flags, clcp->clc_rt);
                goto done;
        }