929 |
void dhcp_stop(struct netif *netif) |
void dhcp_stop(struct netif *netif) |
930 |
{ |
{ |
931 |
struct dhcp *dhcp = netif->dhcp; |
struct dhcp *dhcp = netif->dhcp; |
932 |
|
LWIP_ASSERT("dhcp_stop: netif != NULL", netif != NULL); |
933 |
|
|
934 |
DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_stop()\n")); |
DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_stop()\n")); |
935 |
/* netif is DHCP configured? */ |
/* netif is DHCP configured? */ |
936 |
if (dhcp != NULL) |
if (dhcp != NULL) |
1104 |
u8_t *options_ptr; |
u8_t *options_ptr; |
1105 |
u8_t msg_type; |
u8_t msg_type; |
1106 |
u8_t i; |
u8_t i; |
1107 |
DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_recv() from DHCP server %u.%u.%u.%u port %u\n", port)); |
DEBUGF(DHCP_DEBUG | DBG_TRACE | 3, ("dhcp_recv(pbuf = %p) from DHCP server %u.%u.%u.%u port %u\n", p, |
1108 |
|
(u8_t)(ntohl(addr->addr) >> 24 & 0xff), (u8_t)(ntohl(addr->addr) >> 16 & 0xff), |
1109 |
|
(u8_t)(ntohl(addr->addr) >> 8 & 0xff), (u8_t)(ntohl(addr->addr) & 0xff), port)); |
1110 |
DEBUGF(DHCP_DEBUG | DBG_TRACE, ("pbuf->len = %u\n", p->len)); |
DEBUGF(DHCP_DEBUG | DBG_TRACE, ("pbuf->len = %u\n", p->len)); |
1111 |
DEBUGF(DHCP_DEBUG | DBG_TRACE, ("pbuf->tot_len = %u\n", p->tot_len)); |
DEBUGF(DHCP_DEBUG | DBG_TRACE, ("pbuf->tot_len = %u\n", p->tot_len)); |
1112 |
|
/* prevent warnings about unused arguments */ |
1113 |
|
(void)pcb; (void)addr; (void)port; |
1114 |
dhcp->p = p; |
dhcp->p = p; |
1115 |
|
/* TODO: check packet length before reading them */ |
1116 |
if (reply_msg->op != DHCP_BOOTREPLY) { |
if (reply_msg->op != DHCP_BOOTREPLY) { |
1117 |
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)); |
1118 |
pbuf_free(p); |
pbuf_free(p); |