mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-06 00:39:59 +00:00
Correctly identify link-local addresses when sending ARP packets
This commit is contained in:
parent
fcf6434b4b
commit
4649c14856
@ -733,9 +733,10 @@ etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p)
|
|||||||
(netif->hwaddr_len == ETHARP_HWADDR_LEN));
|
(netif->hwaddr_len == ETHARP_HWADDR_LEN));
|
||||||
i = ETHARP_HWADDR_LEN;
|
i = ETHARP_HWADDR_LEN;
|
||||||
#if LWIP_AUTOIP
|
#if LWIP_AUTOIP
|
||||||
/* If we are using Link-Local, ARP packets must be broadcast on the
|
/* If we are using Link-Local, all ARP packets that contain a Link-Local
|
||||||
* link layer. (See RFC3927 Section 2.5) */
|
* 'sender IP address' MUST be sent using link-layer broadcast instead of
|
||||||
ethdst_hwaddr = ((netif->autoip != NULL) && (netif->autoip->state != AUTOIP_STATE_OFF)) ? (u8_t*)(ethbroadcast.addr) : hdr->shwaddr.addr;
|
* link-layer unicast. (See RFC3927 Section 2.5, last paragraph) */
|
||||||
|
ethdst_hwaddr = ip_addr_islinklocal(&netif->ip_addr) ? (u8_t*)(ethbroadcast.addr) : hdr->shwaddr.addr;
|
||||||
#endif /* LWIP_AUTOIP */
|
#endif /* LWIP_AUTOIP */
|
||||||
|
|
||||||
while(i > 0) {
|
while(i > 0) {
|
||||||
@ -1086,9 +1087,10 @@ etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr,
|
|||||||
(netif->hwaddr_len == ETHARP_HWADDR_LEN));
|
(netif->hwaddr_len == ETHARP_HWADDR_LEN));
|
||||||
k = ETHARP_HWADDR_LEN;
|
k = ETHARP_HWADDR_LEN;
|
||||||
#if LWIP_AUTOIP
|
#if LWIP_AUTOIP
|
||||||
/* If we are using Link-Local, ARP packets must be broadcast on the
|
/* If we are using Link-Local, all ARP packets that contain a Link-Local
|
||||||
* link layer. (See RFC3927 Section 2.5) */
|
* 'sender IP address' MUST be sent using link-layer broadcast instead of
|
||||||
ethdst_hwaddr = ((netif->autoip != NULL) && (netif->autoip->state != AUTOIP_STATE_OFF)) ? (u8_t*)(ethbroadcast.addr) : ethdst_addr->addr;
|
* link-layer unicast. (See RFC3927 Section 2.5, last paragraph) */
|
||||||
|
ethdst_hwaddr = ip_addr_islinklocal(ipsrc_addr) ? (u8_t*)(ethbroadcast.addr) : ethdst_addr->addr;
|
||||||
#endif /* LWIP_AUTOIP */
|
#endif /* LWIP_AUTOIP */
|
||||||
/* Write MAC-Addresses (combined loop for both headers) */
|
/* Write MAC-Addresses (combined loop for both headers) */
|
||||||
while(k > 0) {
|
while(k > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user