/[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.23.2.4 by likewise, Tue Apr 15 13:59:29 2003 UTC revision 1.23.2.5 by likewise, Tue May 20 09:15:37 2003 UTC
# Line 1017  static err_t dhcp_unfold_reply(struct dh Line 1017  static err_t dhcp_unfold_reply(struct dh
1017    u8_t *ptr;    u8_t *ptr;
1018    u16_t i;    u16_t i;
1019    u16_t j = 0;    u16_t j = 0;
1020      LWIP_ASSERT("dhcp->p != NULL", dhcp->p != NULL);
1021    /* free any left-overs from previous unfolds */    /* free any left-overs from previous unfolds */
1022    dhcp_free_reply(dhcp);    dhcp_free_reply(dhcp);
1023    /* options present? */    /* options present? */
# Line 1108  static void dhcp_recv(void *arg, struct Line 1109  static void dhcp_recv(void *arg, struct
1109    if (reply_msg->op != DHCP_BOOTREPLY) {    if (reply_msg->op != DHCP_BOOTREPLY) {
1110      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));
1111      pbuf_free(p);      pbuf_free(p);
1112        dhcp->reply_msg = NULL;
1113        dhcp->p = NULL;
1114        return;
1115    }    }
1116    /* iterate through hardware address and match against DHCP message */    /* iterate through hardware address and match against DHCP message */
1117    for (i = 0; i < netif->hwaddr_len; i++) {    for (i = 0; i < netif->hwaddr_len; i++) {
# Line 1115  static void dhcp_recv(void *arg, struct Line 1119  static void dhcp_recv(void *arg, struct
1119        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",
1120          i, netif->hwaddr[i], i, reply_msg->chaddr[i]));          i, netif->hwaddr[i], i, reply_msg->chaddr[i]));
1121        pbuf_free(p);        pbuf_free(p);
1122          dhcp->reply_msg = NULL;
1123          dhcp->p = NULL;
1124        return;        return;
1125      }      }
1126    }    }
# Line 1122  static void dhcp_recv(void *arg, struct Line 1128  static void dhcp_recv(void *arg, struct
1128    if (ntohl(reply_msg->xid) != dhcp->xid) {    if (ntohl(reply_msg->xid) != dhcp->xid) {
1129      DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("transaction id mismatch\n"));      DEBUGF(DHCP_DEBUG | DBG_TRACE | 2, ("transaction id mismatch\n"));
1130      pbuf_free(p);      pbuf_free(p);
1131        dhcp->reply_msg = NULL;
1132        dhcp->p = NULL;
1133      return;      return;
1134    }    }
1135    /* option fields could be unfold? */    /* option fields could be unfold? */
1136    if (dhcp_unfold_reply(dhcp) != ERR_OK) {    if (dhcp_unfold_reply(dhcp) != ERR_OK) {
1137      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"));
1138      pbuf_free(p);      pbuf_free(p);
1139        dhcp->reply_msg = NULL;
1140        dhcp->p = NULL;
1141      return;      return;
1142    }    }
1143        
# Line 1137  static void dhcp_recv(void *arg, struct Line 1147  static void dhcp_recv(void *arg, struct
1147    if (options_ptr == NULL) {    if (options_ptr == NULL) {
1148      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"));
1149      pbuf_free(p);      pbuf_free(p);
1150        dhcp->reply_msg = NULL;
1151        dhcp->p = NULL;
1152      return;      return;
1153    }      }  
1154    
# Line 1179  static void dhcp_recv(void *arg, struct Line 1191  static void dhcp_recv(void *arg, struct
1191      dhcp_handle_offer(netif);      dhcp_handle_offer(netif);
1192    }    }
1193    pbuf_free(p);    pbuf_free(p);
1194      dhcp->reply_msg = NULL;
1195      dhcp->p = NULL;
1196  }  }
1197    
1198    

Legend:
Removed from v.1.23.2.4  
changed lines
  Added in v.1.23.2.5

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