Ignore:
Timestamp:
Jan 15, 2015, 1:13:19 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
60d39b66
Parents:
51c88e8b
git-author:
Sebastian Huber <sebastian.huber@…> (01/15/15 13:13:19)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/20/15 06:11:58)
Message:

libnetworking: Fix close of active sockets

Send a special event to notify tasks waiting for a socket state change
in case this socket gets closed. This prevents a use after free.

Close #785.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/samples/loopback/init.c

    r51c88e8b rf87ede5  
    168168        s1 = accept(s, (struct sockaddr *)&farAddr, &addrlen);
    169169        if (s1 < 0)
    170             rtems_panic("Can't accept connection: %s", strerror(errno));
     170            if (errno == ENXIO)
     171                rtems_task_delete(RTEMS_SELF);
     172            else
     173                rtems_panic("Can't accept connection: %s", strerror(errno));
    171174        else
    172175            printf("ACCEPTED:%lX\n", ntohl(farAddr.sin_addr.s_addr));
Note: See TracChangeset for help on using the changeset viewer.