mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-07-04 20:08:57 +00:00
Fixed bug #31722: IP packets sent with an AutoIP source addr must be sent link-local
This commit is contained in:
parent
b49cf5e7a2
commit
f7627929d5
|
@ -233,6 +233,10 @@ HISTORY
|
||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2010-11-20: Simon Goldschmidt
|
||||||
|
* etharp.c: Fixed bug #31722: IP packets sent with an AutoIP source addr
|
||||||
|
must be sent link-local
|
||||||
|
|
||||||
2010-11-20: Simon Goldschmidt
|
2010-11-20: Simon Goldschmidt
|
||||||
* timers.c: patch #7329: tcp_timer_needed prototype was ifdef'ed out for
|
* timers.c: patch #7329: tcp_timer_needed prototype was ifdef'ed out for
|
||||||
LWIP_TIMERS==0
|
LWIP_TIMERS==0
|
||||||
|
|
|
@ -871,14 +871,25 @@ etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
|
||||||
/* outside local network? */
|
/* outside local network? */
|
||||||
if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask)) &&
|
if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask)) &&
|
||||||
!ip_addr_islinklocal(ipaddr)) {
|
!ip_addr_islinklocal(ipaddr)) {
|
||||||
/* interface has default gateway? */
|
#if LWIP_AUTOIP
|
||||||
if (!ip_addr_isany(&netif->gw)) {
|
struct ip_hdr *iphdr = (struct ip_hdr*)((u8_t*)q->payload +
|
||||||
/* send to hardware address of default gateway IP address */
|
sizeof(struct eth_hdr));
|
||||||
ipaddr = &(netif->gw);
|
/* According to RFC 3297, chapter 2.6.2 (Forwarding Rules), a packet with
|
||||||
/* no default gateway available */
|
a link-local source address must always be "directly to its destination
|
||||||
} else {
|
on the same physical link. The host MUST NOT send the packet to any
|
||||||
/* no route to destination error (default gateway missing) */
|
router for forwarding". */
|
||||||
return ERR_RTE;
|
if (!ip_addr_islinklocal(&iphdr->src))
|
||||||
|
#endif /* LWIP_AUTOIP */
|
||||||
|
{
|
||||||
|
/* interface has default gateway? */
|
||||||
|
if (!ip_addr_isany(&netif->gw)) {
|
||||||
|
/* send to hardware address of default gateway IP address */
|
||||||
|
ipaddr = &(netif->gw);
|
||||||
|
/* no default gateway available */
|
||||||
|
} else {
|
||||||
|
/* no route to destination error (default gateway missing) */
|
||||||
|
return ERR_RTE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if LWIP_NETIF_HWADDRHINT
|
#if LWIP_NETIF_HWADDRHINT
|
||||||
|
|
Loading…
Reference in New Issue
Block a user