COMMAND

    connect()

SYSTEMS AFFECTED

    AIX 4.1.4, 4.1.5, 4.2

PROBLEM

    Cahya Wirawan found that when you run this tcp program abobe as  a
    normal user connect crashes aix.

        #include <sys/types.h>
        #include <sys/socket.h>
        #include <netinet/in.h>
        #include <sys/time.h>
        #include <netdb.h>
        #include <stdio.h>

        main()
        {
                int sock;
                struct sockaddr_in server;
                struct hostent *hp;

                sock = socket(AF_INET, SOCK_STREAM, 0);
                /* or sock = socket(AF_INET, SOCK_STREAM, 6); */
                hp = gethostbyname("localhost");
                bcopy((char*)hp->h_addr, (char*)&server.sin_addr, hp->h_length);
                server.sin_family = AF_INET;
                server.sin_port = 23;
                connect(sock, (struct sockaddr *)&server, sizeof server);
                shutdown(sock, 2);
                server.sin_port = 24;
                connect(sock, (struct sockaddr *)&server, sizeof server);
        }

SOLUTION

    APAR IX66819 will fix it, available in a couple of monthes.  There
    is available an "emergency patch" from IBM. Anon FTP to

        testcase.boulder.ibm.com/aix/fromibm

    and get  the file  reconn.41 (for  AIX 4.1)  or reconn.42 (for AIX
    4.2).  There's a new /usr/lib/methods/netinet and a README.