caep1986 发表于 2014-3-29 20:45:47

lwip中etharp_query函数

如果ip地址在arp表中有相应的表项存在,且表项处于stable状态,此时如果给定的数据包为空为什么还要向该ip地址发送一个arp请求?

aozima 发表于 2014-3-29 21:26:59

/* create an ARP query for the offered IP address, expecting that no host
   responds, as the IP address should not be in use. */
result = etharp_query(netif, &dhcp->offered_ip_addr, NULL);


err_t
etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
{
/* do we have a pending entry? or an implicit query request? */
if ((arp_table.state == ETHARP_STATE_PENDING) || (q == NULL)) {

caep1986 发表于 2014-3-31 20:05:45

aozima 发表于 2014-3-29 21:26


懂了谢谢啦
页: [1]
查看完整版本: lwip中etharp_query函数