BSD 4_4_Lite2 release
[unix-history] / usr / src / sys / netiso / iso_pcb.c
index 6927871..722bed9 100644 (file)
@@ -1,10 +1,36 @@
 /*-
 /*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  *
- * %sccs.include.redist.c%
+ * 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.
  *
  *
- *     @(#)iso_pcb.c   7.12 (Berkeley) %G%
+ * 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.
+ *
+ *     @(#)iso_pcb.c   8.3 (Berkeley) 7/19/94
  */
 
 /***********************************************************
  */
 
 /***********************************************************
@@ -42,27 +68,27 @@ SOFTWARE.
 
 #ifdef ISO
 
 
 #ifdef ISO
 
-#include "param.h"
-#include "systm.h"
-#include "mbuf.h"
-#include "socket.h"
-#include "socketvar.h"
-#include "errno.h"
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/errno.h>
 
 
-#include "argo_debug.h"
-#include "iso.h"
-#include "clnp.h"
-#include "../netinet/in_systm.h"
-#include "../net/if.h"
-#include "../net/route.h"
-#include "iso_pcb.h"
-#include "iso_var.h"
-#include "protosw.h"
+#include <netiso/argo_debug.h>
+#include <netiso/iso.h>
+#include <netiso/clnp.h>
+#include <netinet/in_systm.h>
+#include <net/if.h>
+#include <net/route.h>
+#include <netiso/iso_pcb.h>
+#include <netiso/iso_var.h>
+#include <sys/protosw.h>
 
 #ifdef TPCONS
 
 #ifdef TPCONS
-#include "../netccitt/x25.h"
-#include "../netccitt/pk.h"
-#include "../netccitt/pk_var.h"
+#include <netccitt/x25.h>
+#include <netccitt/pk.h>
+#include <netccitt/pk_var.h>
 #endif
 
 #define PCBNULL (struct isopcb *)0
 #endif
 
 #define PCBNULL (struct isopcb *)0
@@ -174,7 +200,7 @@ iso_pcbbind(isop, nam)
                        printf("iso_pcbbind: bind to NOT zeroisoaddr\n");
                ENDDEBUG
                for (ia = iso_ifaddr; ia; ia = ia->ia_next) 
                        printf("iso_pcbbind: bind to NOT zeroisoaddr\n");
                ENDDEBUG
                for (ia = iso_ifaddr; ia; ia = ia->ia_next) 
-                       if (SAME_ISOADDR(siso, &ia->ia_addr))
+                       if (SAME_ISOIFADDR(siso, &ia->ia_addr))
                                break;
                if (ia == 0)
                        return EADDRNOTAVAIL;
                                break;
                if (ia == 0)
                        return EADDRNOTAVAIL;
@@ -202,6 +228,7 @@ iso_pcbbind(isop, nam)
                register char *cp;
 noname:
                cp = TSEL(isop->isop_laddr);
                register char *cp;
 noname:
                cp = TSEL(isop->isop_laddr);
+               isop->isop_laddr->siso_tlen = 2;
        IFDEBUG(D_ISO)
                printf("iso_pcbbind noname\n");
        ENDDEBUG
        IFDEBUG(D_ISO)
                printf("iso_pcbbind noname\n");
        ENDDEBUG
@@ -588,4 +615,4 @@ iso_pcblookup(head, fportlen, fport, laddr)
        }
        return (struct isopcb *)0;
 }
        }
        return (struct isopcb *)0;
 }
-#endif ISO
+#endif /* ISO */