I am compiling NetSNMP 5.4 with our "mipsel-uclibc-g++" compiler and I am 
receiving this compiler error:

snmpTCPDomain.c: In function `int netsnmp_tcp_accept(netsnmp_transport*)':
snmpTCPDomain.c:199: error: cannot convert `sockaddr_in*' to `sockaddr*' in 
assignment


Should the following line....

    farend = (struct sockaddr_in *) &(addr_pair->remote_addr);
 
be changed to ...

    farend = (struct sockaddr *) &(addr_pair->remote_addr);
 

Here is the original code snipet: 

static int
netsnmp_tcp_accept(netsnmp_transport *t)
{
    struct sockaddr *farend = NULL;
    netsnmp_udp_addr_pair *addr_pair = NULL;
    int             newsock = -1, sockflags = 0;
    socklen_t       farendlen = sizeof(struct sockaddr_in);
    char           *str = NULL;

    addr_pair = (netsnmp_udp_addr_pair *)malloc(sizeof(netsnmp_udp_addr_pair));

    if (addr_pair == NULL) {
        /*
         * Indicate that the acceptance of this socket failed.  
         */
        DEBUGMSGTL(("netsnmp_tcp", "accept: malloc failed\n"));
        return -1;
    }

    farend = (struct sockaddr_in *) &(addr_pair->remote_addr);

    if (t != NULL && t->sock >= 0) {
        newsock = accept(t->sock, farend, &farendlen);

        if (newsock < 0) {
            DEBUGMSGTL(("netsnmp_tcp", "accept failed rc %d errno %d \"%s\"\n",

   etc...
   etc...


       
---------------------------------
Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links. 
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to