Changeset e6a59370 in rtems


Ignore:
Timestamp:
Mar 27, 2007, 4:24:41 AM (13 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
92de6270
Parents:
f588903
Message:

2007-03-26 Ralf Corsépius <ralf.corsepius@…>

  • libnetworking/net/raw_cb.c: Sync with FreeBSD.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rf588903 re6a59370  
     12007-03-26      Ralf Corsépius <ralf.corsepius@rtems.org>
     2
     3        * libnetworking/net/raw_cb.c: Sync with FreeBSD.
     4
    152007-03-26      Joel Sherrill <joel@OARcorp.com>
    26
  • cpukit/libnetworking/net/raw_cb.c

    rf588903 re6a59370  
    1111 *    notice, this list of conditions and the following disclaimer in the
    1212 *    documentation and/or other materials provided with the distribution.
    13  * 3. All advertising materials mentioning features or use of this software
    14  *    must display the following acknowledgement:
    15  *      This product includes software developed by the University of
    16  *      California, Berkeley and its contributors.
    1713 * 4. Neither the name of the University nor the names of its contributors
    1814 *    may be used to endorse or promote products derived from this software
     
    3228 *
    3329 *      @(#)raw_cb.c    8.1 (Berkeley) 6/10/93
     30 * $FreeBSD: src/sys/net/raw_cb.c,v 1.34 2006/06/02 08:27:15 rwatson Exp $
     31 */
     32
     33/*
    3434 * $Id$
    3535 */
     
    5050#include <netinet/in.h>
    5151
     52#ifdef __rtems__
     53#define mtx_lock(x)     /* UNUSED */
     54#define mtx_unlock(x)   /* UNUSED */
     55#define KASSERT(x,y)    /* UNUSED */
     56#endif
     57
    5258/*
    5359 * Routines to manage the raw protocol control blocks.
     
    5965 */
    6066
    61 struct rawcb rawcb;
     67struct rawcb_list_head rawcb_list;
    6268static u_long   raw_sendspace = RAWSNDQ;
    6369static u_long   raw_recvspace = RAWRCVQ;
     
    8894        rp->rcb_proto.sp_family = so->so_proto->pr_domain->dom_family;
    8995        rp->rcb_proto.sp_protocol = proto;
    90         insque(rp, &rawcb);
     96        mtx_lock(&rawcb_mtx);
     97        LIST_INSERT_HEAD(&rawcb_list, rp, list);
     98        mtx_unlock(&rawcb_mtx);
    9199        return (0);
    92100}
     
    102110        struct socket *so = rp->rcb_socket;
    103111
    104         so->so_pcb = 0;
    105         sofree(so);
    106         remque(rp);
     112        KASSERT(so->so_pcb == rp, ("raw_detach: so_pcb != rp"));
     113
     114        so->so_pcb = NULL;
     115        mtx_lock(&rawcb_mtx);
     116        LIST_REMOVE(rp, list);
     117        mtx_unlock(&rawcb_mtx);
    107118#ifdef notdef
    108119        if (rp->rcb_laddr)
     
    114125
    115126/*
    116  * Disconnect and possibly release resources.
     127 * Disconnect raw socket.
    117128 */
    118129void
     
    126137        rp->rcb_faddr = 0;
    127138#endif
    128         if (rp->rcb_socket->so_state & SS_NOFDREF)
    129                 raw_detach(rp);
    130139}
    131140
     
    142151                return (EADDRNOTAVAIL);
    143152        rp = sotorawcb(so);
    144         nam = m_copym(nam, 0, M_COPYALL, M_WAITOK);
     153        nam = m_copym(nam, 0, M_COPYALL, M_TRYWAIT);
    145154        rp->rcb_laddr = mtod(nam, struct sockaddr *);
    146155        return (0);
Note: See TracChangeset for help on using the changeset viewer.