lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Multiple IP addresses


From: Paul
Subject: Re: [lwip-users] Multiple IP addresses
Date: Fri, 11 Jun 2004 22:49:10 +0930
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

Hi Leon,

Thanks for the answers. I have implemented option 2 and it looks like a winner.

Pau;



Leon Woestenberg wrote:

2) If you want something that works now, the easiest thing to do is modify this piece of code in dhcp.c:

---
static void dhcp_timeout(struct netif *netif)
{
  /* back-off period has passed, or server selection timed out */
  if ((dhcp->state == DHCP_BACKING_OFF) ||
      (dhcp->state == DHCP_SELECTING)) {
    dhcp_discover(netif);
  /* receiving the requested lease timed out */
  } else if (dhcp->state == DHCP_REQUESTING) {
---

into this:

---
static void dhcp_timeout(struct netif *netif)
{
  if ((dhcp->state == DHCP_BACKING_OFF)
  {
    /* stop trying DHCP */
    dhcp_stop(netif);
    /* fallback */
    ipconfig_fallback(netif);
  } else if (dhcp->state == DHCP_SELECTING) {
    if (dhcp->tries <= 2) {
      dhcp_discover(netif);
    } else {
      /* stop trying DHCP */
      dhcp_stop(netif);
      /* fallback */
      ipconfig_fallback(netif);
    }
  }

In ipconfig_fallback() configure the network interface as you like.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]