diff options
author | phk <phk@FreeBSD.org> | 1998-12-11 21:47:21 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-12-11 21:47:21 +0000 |
commit | c55aa9c23d5c6f7f964fa71facbba34dd8c6bfc1 (patch) | |
tree | 36ab2d411de88b15a6df37ff739d991b29d1753c | |
parent | acabbd1ccfc6eb7aa51558419768fd7b4a48a6df (diff) | |
download | FreeBSD-src-c55aa9c23d5c6f7f964fa71facbba34dd8c6bfc1.zip FreeBSD-src-c55aa9c23d5c6f7f964fa71facbba34dd8c6bfc1.tar.gz |
Copy application name and connection attributes for accept() sockets from
listen() socket.
Allow setsockopt(APPLNAME) after socket is connected.
-rw-r--r-- | sys/netatm/atm_aal5.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/netatm/atm_aal5.c b/sys/netatm/atm_aal5.c index 954438e..7d6a22b 100644 --- a/sys/netatm/atm_aal5.c +++ b/sys/netatm/atm_aal5.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atm_aal5.c,v 1.2 1998/09/17 09:34:59 phk Exp $ + * @(#) $Id: atm_aal5.c,v 1.3 1998/10/31 20:06:54 phk Exp $ * */ @@ -39,7 +39,7 @@ #include <sys/stat.h> #ifndef lint -__RCSID("@(#) $Id: atm_aal5.c,v 1.2 1998/09/17 09:34:59 phk Exp $"); +__RCSID("@(#) $Id: atm_aal5.c,v 1.3 1998/10/31 20:06:54 phk Exp $"); #endif @@ -693,7 +693,7 @@ atm_aal5_incoming(tok, cop, ap, tokp) Atm_attributes *ap; void **tokp; { - Atm_pcb *atp = tok; + Atm_pcb *atp0 = tok, *atp; struct socket *so; int err = 0; @@ -703,11 +703,11 @@ atm_aal5_incoming(tok, cop, ap, tokp) * Note that our attach function will be called via sonewconn * and it will allocate and setup most of the pcb. */ - atm_sock_stat.as_inconn[atp->atp_type]++; + atm_sock_stat.as_inconn[atp0->atp_type]++; #if (defined(BSD) && (BSD >= 199103)) - so = sonewconn(atp->atp_socket, 0); + so = sonewconn(atp0->atp_socket, 0); #else - so = sonewconn(atp->atp_socket); + so = sonewconn(atp0->atp_socket); #endif if (so) { @@ -716,10 +716,12 @@ atm_aal5_incoming(tok, cop, ap, tokp) */ atp = sotoatmpcb(so); atp->atp_conn = cop; + atp->atp_attr = *atp0->atp_conn->co_lattr; + strncpy(atp->atp_name, atp0->atp_name, T_ATM_APP_NAME_LEN); *tokp = atp; } else { err = ECONNABORTED; - atm_sock_stat.as_connfail[atp->atp_type]++; + atm_sock_stat.as_connfail[atp0->atp_type]++; } return (err); @@ -824,6 +826,7 @@ atm_aal5_ctloutput(so, sopt) break; case T_ATM_CAUSE: + case T_ATM_APP_NAME: break; default: |