This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

timeout occurs in dhcp


Hello All,

While trying to initialise dhcp, timeout occurs during receiving packets.

I have attached part of code which gives this error. Please let me know
what could be the reasons.

Thanks & regards
Sunil Savanur

---------------------------------------------------------------------
OUTPUT :
---------DHCPSTATE_INIT sending:
ews : coming out of DHCPSTATE_INIT sending:
---------DHCPSTATE_SELECTING received:
---------DHCPSTATE_INIT sending:
ews : coming out of DHCPSTATE_INIT sending:
---------DHCPSTATE_SELECTING received:
ews : next_timeout failed in  DHCPSTATE_SELECTING:
---------DHCPSTATE_FAILED received:
After SIOCDIFADDR in do_dhcp_down_net
BOOTP/DHCP failed on eth0
--------------------------------------------------------------------
Code : ===> dhcp_prot.c" line 559 onwards

      case DHCPSTATE_SELECTING:
            // This is a separate state so that we can listen again
            // *without* retransmitting.

            // listen for the DHCPOFFER reply

            diag_printf( "---------DHCPSTATE_SELECTING received:\n" );
            setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));

            addrlen = sizeof(rx_addr);
            if (recvfrom(s, received, sizeof(struct bootp), 0,
                         (struct sockaddr *)&rx_addr, &addrlen) < 0) {
                // No packet arrived (this time)
                if ( seen_bootp_reply ) { // then already have a bootp reply
                    // Save the good packet in *xmit
                    bcopy( received, xmit, dhcp_size(received) );
                    *pstate = DHCPSTATE_BOOTP_FALLBACK;
                    reset_timeout( &tv, &timeout_scratch );
                    break;
                }
                // go to the next larger timeout and re-send:
                if ( ! next_timeout( &tv, &timeout_scratch ) ) {
                        diag_printf( "ews : next_timeout failed in
DHCPSTATE_SELECTING:\n" );
                    *pstate = DHCPSTATE_FAILED;
                    break;
                }
                *pstate = DHCPSTATE_INIT; // to retransmit
                break;
            }
--------------------------------------------------------------------


-----------------------------------------------------------------------------------------------------------------------------
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers
and is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:mailadmin@wipro.com and delete this mail
from your records.
------------------------------------------------------------------------------------------------------------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]