mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-28 11:07:51 +08:00
Cleaned up using struct netif.ip_addr by creating API functions for it
This commit is contained in:
@@ -120,7 +120,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
||||
if (ip_addr_isbroadcast(ip_current_dest_addr(), ip_current_netif())) {
|
||||
#if LWIP_BROADCAST_PING
|
||||
/* For broadcast, use address of receiving interface as source address */
|
||||
src = &inp->ip_addr;
|
||||
src = netif_ip4_addr(inp);
|
||||
#else /* LWIP_BROADCAST_PING */
|
||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: Not echoing to broadcast pings\n"));
|
||||
goto icmperr;
|
||||
|
||||
@@ -683,7 +683,7 @@ udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_i
|
||||
#if LWIP_IPV4
|
||||
if (ip4_addr_isany(ip_2_ip4(&pcb->local_ip))) {
|
||||
/* use outgoing network interface IP address as source address */
|
||||
src_ip = &netif->ip_addr;
|
||||
src_ip = netif_ip_addr4(netif);
|
||||
} else {
|
||||
/* check if UDP PCB local IP address is correct
|
||||
* this could be an old address if netif->ip_addr has changed */
|
||||
|
||||
Reference in New Issue
Block a user