/[lwip]/lwip/src/core/dhcp.c
ViewVC logotype

Diff of /lwip/src/core/dhcp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.30 by likewise, Tue May 20 09:04:10 2003 UTC revision 1.31 by likewise, Tue May 20 09:49:04 2003 UTC
# Line 1033  static err_t dhcp_unfold_reply(struct dh Line 1033  static err_t dhcp_unfold_reply(struct dh
1033    u8_t *ptr;    u8_t *ptr;
1034    u16_t i;    u16_t i;
1035    u16_t j = 0;    u16_t j = 0;
1036      LWIP_ASSERT("dhcp->p != NULL", dhcp->p != NULL);
1037    /* free any left-overs from previous unfolds */    /* free any left-overs from previous unfolds */
1038    dhcp_free_reply(dhcp);    dhcp_free_reply(dhcp);
1039    /* options present? */    /* options present? */
# Line 1129  static void dhcp_recv(void *arg, struct Line 1130  static void dhcp_recv(void *arg, struct
1130    if (reply_msg->op != DHCP_BOOTREPLY) {    if (reply_msg->op != DHCP_BOOTREPLY) {
1131      DEBUGF(DHCP_DEBUG | DBG_TRACE | 1, ("not a DHCP reply message, but type %u\n", reply_msg->op));      DEBUGF(DHCP_DEBUG | DBG_TRACE | 1, ("not a DHCP reply message, but type %u\n", reply_msg->op));
1132      pbuf_free(p);      pbuf_free(p);
1133        dhcp->p = NULL;
1134        return;
1135    }    }
1136    /* iterate through hardware address and match against DHCP message */    /* iterate through hardware address and match against DHCP message */
1137    for (i = 0; i < netif->hwaddr_len; i++) {    for (i = 0; i < netif->hwaddr_len; i++) {
# Line 1136  static void dhcp_recv(void *arg, struct Line 1139  static void dhcp_recv(void *arg, struct
1139        DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("netif->hwaddr[%u]==%02x != reply_msg->chaddr[%u]==%02x\n",        DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("netif->hwaddr[%u]==%02x != reply_msg->chaddr[%u]==%02x\n",
1140          i, netif->hwaddr[i], i, reply_msg->chaddr[i]));          i, netif->hwaddr[i], i, reply_msg->chaddr[i]));
1141        pbuf_free(p);        pbuf_free(p);
1142          dhcp->p = NULL;
1143        return;        return;
1144      }      }
1145    }    }
# Line 1143  static void dhcp_recv(void *arg, struct Line 1147  static void dhcp_recv(void *arg, struct
1147    if (ntohl(reply_msg->xid) != dhcp->xid) {    if (ntohl(reply_msg->xid) != dhcp->xid) {
1148      DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("transaction id mismatch\n"));      DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("transaction id mismatch\n"));
1149      pbuf_free(p);      pbuf_free(p);
1150        dhcp->p = NULL;
1151      return;      return;
1152    }    }
1153    /* option fields could be unfold? */    /* option fields could be unfold? */
1154    if (dhcp_unfold_reply(dhcp) != ERR_OK) {    if (dhcp_unfold_reply(dhcp) != ERR_OK) {
1155      DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("problem unfolding DHCP message - too short on memory?\n"));      DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("problem unfolding DHCP message - too short on memory?\n"));
1156      pbuf_free(p);      pbuf_free(p);
1157        dhcp->p = NULL;
1158      return;      return;
1159    }    }
1160        
# Line 1158  static void dhcp_recv(void *arg, struct Line 1164  static void dhcp_recv(void *arg, struct
1164    if (options_ptr == NULL) {    if (options_ptr == NULL) {
1165      DEBUGF(DHCP_DEBUG | DBG_TRACE | 1, ("DHCP_OPTION_MESSAGE_TYPE option not found\n"));      DEBUGF(DHCP_DEBUG | DBG_TRACE | 1, ("DHCP_OPTION_MESSAGE_TYPE option not found\n"));
1166      pbuf_free(p);      pbuf_free(p);
1167        dhcp->p = NULL;
1168      return;      return;
1169    }      }  
1170    
# Line 1200  static void dhcp_recv(void *arg, struct Line 1207  static void dhcp_recv(void *arg, struct
1207      dhcp_handle_offer(netif);      dhcp_handle_offer(netif);
1208    }    }
1209    pbuf_free(p);    pbuf_free(p);
1210      dhcp->p = NULL;
1211  }  }
1212    
1213    

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26