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? */ |
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++) { |
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 |
} |
} |
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 |
|
|
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 |
|
|
1207 |
dhcp_handle_offer(netif); |
dhcp_handle_offer(netif); |
1208 |
} |
} |
1209 |
pbuf_free(p); |
pbuf_free(p); |
1210 |
|
dhcp->p = NULL; |
1211 |
} |
} |
1212 |
|
|
1213 |
|
|