Subversion Repositories HelenOS

Rev

Rev 4589 | Rev 4700 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4589 Rev 4603
Line 253... Line 253...
253
                break;
253
                break;
254
            case NET_SOCKET_RECVFROM:
254
            case NET_SOCKET_RECVFROM:
255
                res = udp_recvfrom_message( & local_sockets, SOCKET_GET_SOCKET_ID( call ), SOCKET_GET_FLAGS( call ));
255
                res = udp_recvfrom_message( & local_sockets, SOCKET_GET_SOCKET_ID( call ), SOCKET_GET_FLAGS( call ));
256
                if( res > 0 ){
256
                if( res > 0 ){
257
                    * SOCKET_SET_READ_DATA_LENGTH( answer ) = res;
257
                    * SOCKET_SET_READ_DATA_LENGTH( answer ) = res;
-
 
258
                    * SOCKET_SET_ADDRESS_LENGTH( answer ) = sizeof( struct sockaddr_in );
258
                    * answer_count = 1;
259
                    * answer_count = 2;
259
                    res = EOK;
260
                    res = EOK;
260
                }
261
                }
261
                break;
262
                break;
262
            case NET_SOCKET_CLOSE:
263
            case NET_SOCKET_CLOSE:
263
                res = socket_destroy( udp_globals.net_phone, SOCKET_GET_SOCKET_ID( call ), & local_sockets, & udp_globals.sockets );
264
                res = socket_destroy( udp_globals.net_phone, SOCKET_GET_SOCKET_ID( call ), & local_sockets, & udp_globals.sockets );
Line 386... Line 387...
386
        return NO_DATA;
387
        return NO_DATA;
387
    }
388
    }
388
    header = ( udp_header_ref ) data;
389
    header = ( udp_header_ref ) data;
389
    // set the source address
390
    // set the source address
390
    address.sin_family = PF_INET;
391
    address.sin_family = PF_INET;
391
    address.sin_port = ntohs( header->dest );
392
    address.sin_port = ntohs( header->source );
392
    length = packet_get_addr( packet, & addr, NULL );
393
    length = packet_get_addr( packet, & addr, NULL );
393
    if( length != sizeof( address.sin_addr.s_addr )){
394
    if( length != sizeof( address.sin_addr.s_addr )){
394
        pq_release( udp_globals.net_phone, packet_id );
395
        pq_release( udp_globals.net_phone, packet_id );
395
        return EINVAL;
396
        return EINVAL;
396
    }
397
    }