2003-08-07 20:26:28 +04:00
|
|
|
/* $NetBSD: clnp_raw.c,v 1.19 2003/08/07 16:33:33 agc Exp $ */
|
1994-06-29 10:29:24 +04:00
|
|
|
|
1993-04-09 16:00:07 +04:00
|
|
|
/*-
|
1994-05-13 10:08:03 +04:00
|
|
|
* Copyright (c) 1991, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-04-09 16:00:07 +04:00
|
|
|
*
|
|
|
|
* 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.
|
2003-08-07 20:26:28 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1993-04-09 16:00:07 +04:00
|
|
|
* 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.
|
|
|
|
*
|
1994-06-29 10:29:24 +04:00
|
|
|
* @(#)clnp_raw.c 8.1 (Berkeley) 6/10/93
|
1993-04-09 16:00:07 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
Copyright IBM Corporation 1987
|
|
|
|
|
|
|
|
All Rights Reserved
|
|
|
|
|
1996-02-14 01:07:57 +03:00
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
|
|
documentation for any purpose and without fee is hereby granted,
|
1993-04-09 16:00:07 +04:00
|
|
|
provided that the above copyright notice appear in all copies and that
|
1996-02-14 01:07:57 +03:00
|
|
|
both that copyright notice and this permission notice appear in
|
1993-04-09 16:00:07 +04:00
|
|
|
supporting documentation, and that the name of IBM not be
|
|
|
|
used in advertising or publicity pertaining to distribution of the
|
1996-02-14 01:07:57 +03:00
|
|
|
software without specific, written prior permission.
|
1993-04-09 16:00:07 +04:00
|
|
|
|
|
|
|
IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
|
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
|
|
IBM 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.
|
|
|
|
|
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
|
|
|
|
*/
|
|
|
|
|
2001-11-13 03:56:55 +03:00
|
|
|
#include <sys/cdefs.h>
|
2003-08-07 20:26:28 +04:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: clnp_raw.c,v 1.19 2003/08/07 16:33:33 agc Exp $");
|
2001-11-13 03:56:55 +03:00
|
|
|
|
1993-12-18 03:40:47 +03:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/mbuf.h>
|
|
|
|
#include <sys/domain.h>
|
|
|
|
#include <sys/protosw.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/socketvar.h>
|
|
|
|
#include <sys/errno.h>
|
|
|
|
#include <sys/time.h>
|
1996-02-14 01:07:57 +03:00
|
|
|
#include <sys/systm.h>
|
1993-04-09 16:00:07 +04:00
|
|
|
|
1993-12-18 03:40:47 +03:00
|
|
|
#include <net/if.h>
|
|
|
|
#include <net/route.h>
|
|
|
|
#include <net/raw_cb.h>
|
1993-04-09 16:00:07 +04:00
|
|
|
|
1993-12-18 03:40:47 +03:00
|
|
|
#include <netiso/iso.h>
|
|
|
|
#include <netiso/iso_pcb.h>
|
|
|
|
#include <netiso/clnp.h>
|
|
|
|
#include <netiso/clnp_stat.h>
|
|
|
|
#include <netiso/argo_debug.h>
|
1993-04-09 16:00:07 +04:00
|
|
|
|
1996-02-14 01:07:57 +03:00
|
|
|
#include <netiso/tp_user.h> /* XXX -- defines SOL_NETWORK */
|
1993-04-09 16:00:07 +04:00
|
|
|
|
1996-02-14 01:07:57 +03:00
|
|
|
#include <machine/stdarg.h>
|
|
|
|
|
|
|
|
struct sockproto rclnp_proto = {PF_ISO, 0};
|
1993-04-09 16:00:07 +04:00
|
|
|
/*
|
|
|
|
* FUNCTION: rclnp_input
|
|
|
|
*
|
1996-02-14 01:07:57 +03:00
|
|
|
* PURPOSE: Setup generic address an protocol structures for
|
|
|
|
* raw input routine, then pass them along with the
|
|
|
|
* mbuf chain.
|
1993-04-09 16:00:07 +04:00
|
|
|
*
|
1996-02-14 01:07:57 +03:00
|
|
|
* RETURNS: none
|
1993-04-09 16:00:07 +04:00
|
|
|
*
|
1996-02-14 01:07:57 +03:00
|
|
|
* SIDE EFFECTS:
|
1993-04-09 16:00:07 +04:00
|
|
|
*
|
1996-02-14 01:07:57 +03:00
|
|
|
* NOTES: The protocol field of rclnp_proto is set to zero
|
|
|
|
* indicating no protocol.
|
1993-04-09 16:00:07 +04:00
|
|
|
*/
|
1994-05-13 10:08:03 +04:00
|
|
|
void
|
1996-02-14 01:07:57 +03:00
|
|
|
#if __STDC__
|
|
|
|
rclnp_input(struct mbuf *m, ...)
|
|
|
|
#else
|
|
|
|
rclnp_input(m, va_alist)
|
|
|
|
struct mbuf *m; /* ptr to packet */
|
|
|
|
va_dcl
|
|
|
|
#endif
|
1993-04-09 16:00:07 +04:00
|
|
|
{
|
1996-02-14 01:07:57 +03:00
|
|
|
struct sockaddr_iso *src; /* ptr to src address */
|
|
|
|
struct sockaddr_iso *dst; /* ptr to dest address */
|
|
|
|
int hdrlen; /* length (in bytes) of clnp header */
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
va_start(ap, m);
|
|
|
|
src = va_arg(ap, struct sockaddr_iso *);
|
|
|
|
dst = va_arg(ap, struct sockaddr_iso *);
|
|
|
|
hdrlen = va_arg(ap, int);
|
|
|
|
va_end(ap);
|
1993-04-09 16:00:07 +04:00
|
|
|
#ifdef TROLL
|
|
|
|
if (trollctl.tr_ops & TR_CHUCK) {
|
|
|
|
m_freem(m);
|
|
|
|
return;
|
|
|
|
}
|
1996-02-14 01:07:57 +03:00
|
|
|
#endif /* TROLL */
|
1993-04-09 16:00:07 +04:00
|
|
|
|
1995-06-13 11:13:14 +04:00
|
|
|
raw_input(m, &rclnp_proto, sisotosa(src), sisotosa(dst));
|
1993-04-09 16:00:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* FUNCTION: rclnp_output
|
|
|
|
*
|
|
|
|
* PURPOSE: Prepare to send a raw clnp packet. Setup src and dest
|
|
|
|
* addresses, count the number of bytes to send, and
|
|
|
|
* call clnp_output.
|
|
|
|
*
|
|
|
|
* RETURNS: success - 0
|
|
|
|
* failure - an appropriate error code
|
|
|
|
*
|
1996-02-14 01:07:57 +03:00
|
|
|
* SIDE EFFECTS:
|
1993-04-09 16:00:07 +04:00
|
|
|
*
|
1996-02-14 01:07:57 +03:00
|
|
|
* NOTES:
|
1993-04-09 16:00:07 +04:00
|
|
|
*/
|
1996-02-14 01:07:57 +03:00
|
|
|
int
|
|
|
|
#if __STDC__
|
|
|
|
rclnp_output(struct mbuf *m0, ...)
|
|
|
|
#else
|
|
|
|
rclnp_output(m0, va_alist)
|
|
|
|
struct mbuf *m0; /* packet to send */
|
|
|
|
va_dcl
|
|
|
|
#endif
|
1993-04-09 16:00:07 +04:00
|
|
|
{
|
1996-02-14 01:07:57 +03:00
|
|
|
struct socket *so; /* socket to send from */
|
|
|
|
struct rawisopcb *rp; /* ptr to raw cb */
|
|
|
|
int error; /* return value of function */
|
|
|
|
int flags; /* flags for clnp_output */
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
va_start(ap, m0);
|
|
|
|
so = va_arg(ap, struct socket *);
|
|
|
|
va_end(ap);
|
|
|
|
rp = sotorawisopcb(so);
|
1993-04-09 16:00:07 +04:00
|
|
|
|
1996-02-14 01:07:57 +03:00
|
|
|
if ((m0->m_flags & M_PKTHDR) == 0)
|
1993-04-09 16:00:07 +04:00
|
|
|
return (EINVAL);
|
|
|
|
/*
|
1996-02-14 01:07:57 +03:00
|
|
|
* Set up src address. If user has bound socket to an address, use it.
|
|
|
|
* Otherwise, do not specify src (clnp_output will fill it in).
|
1993-04-09 16:00:07 +04:00
|
|
|
*/
|
|
|
|
if (rp->risop_rcb.rcb_laddr) {
|
|
|
|
if (rp->risop_isop.isop_sladdr.siso_family != AF_ISO) {
|
1996-02-14 01:07:57 +03:00
|
|
|
bad:
|
1993-04-09 16:00:07 +04:00
|
|
|
m_freem(m0);
|
1996-02-14 01:07:57 +03:00
|
|
|
return (EAFNOSUPPORT);
|
1993-04-09 16:00:07 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/* set up dest address */
|
|
|
|
if (rp->risop_rcb.rcb_faddr == 0)
|
|
|
|
goto bad;
|
1995-06-13 11:13:14 +04:00
|
|
|
rp->risop_isop.isop_sfaddr = *satosiso(rp->risop_rcb.rcb_faddr);
|
1993-04-09 16:00:07 +04:00
|
|
|
rp->risop_isop.isop_faddr = &rp->risop_isop.isop_sfaddr;
|
|
|
|
|
|
|
|
/* get flags and ship it off */
|
|
|
|
flags = rp->risop_flags & CLNP_VFLAGS;
|
|
|
|
|
|
|
|
error = clnp_output(m0, &rp->risop_isop, m0->m_pkthdr.len,
|
1996-02-14 01:07:57 +03:00
|
|
|
flags | CLNP_NOCACHE);
|
1993-04-09 16:00:07 +04:00
|
|
|
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* FUNCTION: rclnp_ctloutput
|
|
|
|
*
|
|
|
|
* PURPOSE: Raw clnp socket option processing
|
1996-02-14 01:07:57 +03:00
|
|
|
* All options are stored inside an mbuf.
|
1993-04-09 16:00:07 +04:00
|
|
|
*
|
|
|
|
* RETURNS: success - 0
|
|
|
|
* failure - unix error code
|
|
|
|
*
|
|
|
|
* SIDE EFFECTS: If the options mbuf does not exist, it the mbuf passed
|
|
|
|
* is used.
|
|
|
|
*
|
1996-02-14 01:07:57 +03:00
|
|
|
* NOTES:
|
1993-04-09 16:00:07 +04:00
|
|
|
*/
|
1996-02-14 01:07:57 +03:00
|
|
|
int
|
1993-04-09 16:00:07 +04:00
|
|
|
rclnp_ctloutput(op, so, level, optname, m)
|
1996-02-14 01:07:57 +03:00
|
|
|
int op; /* type of operation */
|
|
|
|
struct socket *so; /* ptr to socket */
|
|
|
|
int level; /* level of option */
|
|
|
|
int optname;/* name of option */
|
|
|
|
struct mbuf **m; /* ptr to ptr to option data */
|
1993-04-09 16:00:07 +04:00
|
|
|
{
|
1996-02-14 01:07:57 +03:00
|
|
|
int error = 0;
|
2000-03-30 16:51:13 +04:00
|
|
|
struct rawisopcb *rp = sotorawisopcb(so); /* raw cb ptr */
|
1993-04-09 16:00:07 +04:00
|
|
|
|
1996-02-14 01:07:57 +03:00
|
|
|
#ifdef ARGO_DEBUG
|
|
|
|
if (argo_debug[D_CTLOUTPUT]) {
|
1996-10-13 06:03:00 +04:00
|
|
|
printf("rclnp_ctloutput: op = x%x, level = x%x, name = x%x\n",
|
1996-10-11 03:12:43 +04:00
|
|
|
op, level, optname);
|
1993-04-09 16:00:07 +04:00
|
|
|
if (*m != NULL) {
|
1996-10-13 06:03:00 +04:00
|
|
|
printf("rclnp_ctloutput: %d bytes of mbuf data\n", (*m)->m_len);
|
1993-04-09 16:00:07 +04:00
|
|
|
dump_buf(mtod((*m), caddr_t), (*m)->m_len);
|
|
|
|
}
|
1996-02-14 01:07:57 +03:00
|
|
|
}
|
|
|
|
#endif
|
1993-04-09 16:00:07 +04:00
|
|
|
|
|
|
|
#ifdef SOL_NETWORK
|
|
|
|
if (level != SOL_NETWORK)
|
|
|
|
error = EINVAL;
|
1996-02-14 01:07:57 +03:00
|
|
|
else
|
|
|
|
switch (op) {
|
1993-04-09 16:00:07 +04:00
|
|
|
#else
|
|
|
|
switch (op) {
|
1996-02-14 01:07:57 +03:00
|
|
|
#endif /* SOL_NETWORK */
|
|
|
|
case PRCO_SETOPT:
|
|
|
|
switch (optname) {
|
|
|
|
case CLNPOPT_FLAGS:{
|
|
|
|
u_short usr_flags;
|
|
|
|
/*
|
|
|
|
* Insure that the data passed has exactly
|
|
|
|
* one short in it
|
|
|
|
*/
|
|
|
|
if ((*m == NULL) || ((*m)->m_len != sizeof(short))) {
|
|
|
|
error = EINVAL;
|
1993-04-09 16:00:07 +04:00
|
|
|
break;
|
1996-02-14 01:07:57 +03:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
* Don't allow invalid flags to be set
|
|
|
|
*/
|
|
|
|
usr_flags = (*mtod((*m), short *));
|
1993-04-09 16:00:07 +04:00
|
|
|
|
1996-02-14 01:07:57 +03:00
|
|
|
if ((usr_flags & (CLNP_VFLAGS)) != usr_flags) {
|
1993-04-09 16:00:07 +04:00
|
|
|
error = EINVAL;
|
1996-02-14 01:07:57 +03:00
|
|
|
} else
|
|
|
|
rp->risop_flags |= usr_flags;
|
|
|
|
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case CLNPOPT_OPTS:
|
|
|
|
error = clnp_set_opts(&rp->risop_isop.isop_options, m);
|
|
|
|
if (error)
|
|
|
|
break;
|
|
|
|
rp->risop_isop.isop_optindex = m_get(M_WAIT, MT_SOOPTS);
|
|
|
|
(void) clnp_opt_sanity(rp->risop_isop.isop_options,
|
|
|
|
mtod(rp->risop_isop.isop_options, caddr_t),
|
|
|
|
rp->risop_isop.isop_options->m_len,
|
|
|
|
mtod(rp->risop_isop.isop_optindex,
|
|
|
|
struct clnp_optidx *));
|
1993-04-09 16:00:07 +04:00
|
|
|
break;
|
1996-02-14 01:07:57 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PRCO_GETOPT:
|
|
|
|
#ifdef notdef
|
|
|
|
/* commented out to keep hi C quiet */
|
|
|
|
switch (optname) {
|
1993-04-09 16:00:07 +04:00
|
|
|
default:
|
|
|
|
error = EINVAL;
|
|
|
|
break;
|
1996-02-14 01:07:57 +03:00
|
|
|
}
|
|
|
|
#endif /* notdef */
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error = EINVAL;
|
|
|
|
break;
|
1993-04-09 16:00:07 +04:00
|
|
|
}
|
|
|
|
if (op == PRCO_SETOPT) {
|
|
|
|
/* note: m_freem does not barf is *m is NULL */
|
|
|
|
m_freem(*m);
|
|
|
|
*m = NULL;
|
|
|
|
}
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
1996-02-14 01:07:57 +03:00
|
|
|
/* ARGSUSED */
|
|
|
|
int
|
2003-06-30 02:28:00 +04:00
|
|
|
clnp_usrreq(so, req, m, nam, control, p)
|
1996-05-22 17:54:55 +04:00
|
|
|
struct socket *so;
|
|
|
|
int req;
|
|
|
|
struct mbuf *m, *nam, *control;
|
2003-06-30 02:28:00 +04:00
|
|
|
struct proc *p;
|
1993-04-09 16:00:07 +04:00
|
|
|
{
|
2000-03-30 16:51:13 +04:00
|
|
|
int error = 0;
|
|
|
|
struct rawisopcb *rp = sotorawisopcb(so);
|
1993-04-09 16:00:07 +04:00
|
|
|
|
|
|
|
rp = sotorawisopcb(so);
|
|
|
|
switch (req) {
|
|
|
|
|
|
|
|
case PRU_ATTACH:
|
1996-09-08 18:28:08 +04:00
|
|
|
if (rp != 0) {
|
|
|
|
error = EISCONN;
|
|
|
|
break;
|
|
|
|
}
|
1993-04-09 16:00:07 +04:00
|
|
|
MALLOC(rp, struct rawisopcb *, sizeof *rp, M_PCB, M_WAITOK);
|
|
|
|
if (rp == 0)
|
|
|
|
return (ENOBUFS);
|
1996-02-14 01:07:57 +03:00
|
|
|
bzero(rp, sizeof *rp);
|
1995-08-17 06:57:20 +04:00
|
|
|
so->so_pcb = rp;
|
1993-04-09 16:00:07 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PRU_DETACH:
|
|
|
|
if (rp->risop_isop.isop_options)
|
|
|
|
m_freem(rp->risop_isop.isop_options);
|
|
|
|
if (rp->risop_isop.isop_route.ro_rt)
|
|
|
|
RTFREE(rp->risop_isop.isop_route.ro_rt);
|
|
|
|
if (rp->risop_rcb.rcb_laddr)
|
|
|
|
rp->risop_rcb.rcb_laddr = 0;
|
|
|
|
/* free clnp cached hdr if necessary */
|
|
|
|
if (rp->risop_isop.isop_clnpcache != NULL) {
|
1996-02-14 01:07:57 +03:00
|
|
|
struct clnp_cache *clcp =
|
|
|
|
mtod(rp->risop_isop.isop_clnpcache, struct clnp_cache *);
|
1993-04-09 16:00:07 +04:00
|
|
|
if (clcp->clc_hdr != NULL) {
|
|
|
|
m_free(clcp->clc_hdr);
|
|
|
|
}
|
|
|
|
m_free(rp->risop_isop.isop_clnpcache);
|
|
|
|
}
|
|
|
|
if (rp->risop_isop.isop_optindex != NULL)
|
|
|
|
m_free(rp->risop_isop.isop_optindex);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PRU_BIND:
|
1996-02-14 01:07:57 +03:00
|
|
|
{
|
|
|
|
struct sockaddr_iso *addr = mtod(nam, struct sockaddr_iso *);
|
|
|
|
|
|
|
|
if (nam->m_len != sizeof(*addr))
|
|
|
|
return (EINVAL);
|
|
|
|
if ((ifnet.tqh_first == 0) ||
|
|
|
|
(addr->siso_family != AF_ISO) ||
|
|
|
|
(addr->siso_addr.isoa_len &&
|
|
|
|
ifa_ifwithaddr(sisotosa(addr)) == 0))
|
|
|
|
return (EADDRNOTAVAIL);
|
|
|
|
rp->risop_isop.isop_sladdr = *addr;
|
|
|
|
rp->risop_rcb.rcb_laddr = sisotosa(
|
|
|
|
(rp->risop_isop.isop_laddr = &rp->risop_isop.isop_sladdr));
|
|
|
|
return (0);
|
|
|
|
}
|
1993-04-09 16:00:07 +04:00
|
|
|
case PRU_CONNECT:
|
1996-02-14 01:07:57 +03:00
|
|
|
{
|
|
|
|
struct sockaddr_iso *addr = mtod(nam, struct sockaddr_iso *);
|
|
|
|
|
|
|
|
if ((nam->m_len > sizeof(*addr)) || (addr->siso_len > sizeof(*addr)))
|
|
|
|
return (EINVAL);
|
|
|
|
if (ifnet.tqh_first == 0)
|
|
|
|
return (EADDRNOTAVAIL);
|
2003-02-08 14:11:11 +03:00
|
|
|
|
|
|
|
/* copy the address */
|
1996-02-14 01:07:57 +03:00
|
|
|
if (addr->siso_family != AF_ISO)
|
|
|
|
rp->risop_isop.isop_sfaddr = *addr;
|
2003-02-08 14:11:11 +03:00
|
|
|
|
|
|
|
/* initialize address pointers */
|
|
|
|
rp->risop_isop.isop_faddr = &rp->risop_isop.isop_sfaddr;
|
1996-02-14 01:07:57 +03:00
|
|
|
rp->risop_rcb.rcb_faddr = sisotosa(
|
2003-02-08 14:11:11 +03:00
|
|
|
rp->risop_isop.isop_faddr);
|
|
|
|
|
|
|
|
/* address setup, mark socket connected */
|
1996-02-14 01:07:57 +03:00
|
|
|
soisconnected(so);
|
2003-02-08 14:11:11 +03:00
|
|
|
|
1996-02-14 01:07:57 +03:00
|
|
|
return (0);
|
|
|
|
}
|
1993-04-09 16:00:07 +04:00
|
|
|
}
|
2003-06-30 02:28:00 +04:00
|
|
|
error = raw_usrreq(so, req, m, nam, control, p);
|
1993-04-09 16:00:07 +04:00
|
|
|
|
|
|
|
if (error && req == PRU_ATTACH && so->so_pcb)
|
1996-02-14 01:07:57 +03:00
|
|
|
free((caddr_t) rp, M_PCB);
|
1993-04-09 16:00:07 +04:00
|
|
|
return (error);
|
|
|
|
}
|