mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-25 01:27:05 +08:00
Removed ip_2_ip4/6_c const macros again now that ip_2_ip4/6 macros keep the original const'ness
This commit is contained in:
@@ -1597,7 +1597,7 @@ dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr,
|
||||
#endif /* LWIP_IPV6 */
|
||||
|
||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_recv(pbuf = %p) from DHCP server %"U16_F".%"U16_F".%"U16_F".%"U16_F" port %"U16_F"\n", (void*)p,
|
||||
ip4_addr1_16(ip_2_ip4_c(addr)), ip4_addr2_16(ip_2_ip4_c(addr)), ip4_addr3_16(ip_2_ip4_c(addr)), ip4_addr4_16(ip_2_ip4_c(addr)), port));
|
||||
ip4_addr1_16(ip_2_ip4(addr)), ip4_addr2_16(ip_2_ip4(addr)), ip4_addr3_16(ip_2_ip4(addr)), ip4_addr4_16(ip_2_ip4(addr)), port));
|
||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("pbuf->len = %"U16_F"\n", p->len));
|
||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("pbuf->tot_len = %"U16_F"\n", p->tot_len));
|
||||
/* prevent warnings about unused arguments */
|
||||
|
||||
@@ -386,7 +386,7 @@ ip_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
|
||||
{
|
||||
#if LWIP_IPV6
|
||||
if (IP_IS_V6(dest)) {
|
||||
return ip6_chksum_pseudo(p, proto, proto_len, ip_2_ip6_c(src), ip_2_ip6_c(dest));
|
||||
return ip6_chksum_pseudo(p, proto, proto_len, ip_2_ip6(src), ip_2_ip6(dest));
|
||||
}
|
||||
#endif /* LWIP_IPV6 */
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
@@ -394,7 +394,7 @@ ip_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
|
||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
||||
#if LWIP_IPV4
|
||||
{
|
||||
return inet_chksum_pseudo(p, proto, proto_len, ip_2_ip4_c(src), ip_2_ip4_c(dest));
|
||||
return inet_chksum_pseudo(p, proto, proto_len, ip_2_ip4(src), ip_2_ip4(dest));
|
||||
}
|
||||
#endif /* LWIP_IPV4 */
|
||||
}
|
||||
@@ -533,7 +533,7 @@ ip_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
|
||||
{
|
||||
#if LWIP_IPV6
|
||||
if (IP_IS_V6(dest)) {
|
||||
return ip6_chksum_pseudo_partial(p, proto, proto_len, chksum_len, ip_2_ip6_c(src), ip_2_ip6_c(dest));
|
||||
return ip6_chksum_pseudo_partial(p, proto, proto_len, chksum_len, ip_2_ip6(src), ip_2_ip6(dest));
|
||||
}
|
||||
#endif /* LWIP_IPV6 */
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
@@ -541,7 +541,7 @@ ip_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
|
||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
||||
#if LWIP_IPV4
|
||||
{
|
||||
return inet_chksum_pseudo_partial(p, proto, proto_len, chksum_len, ip_2_ip4_c(src), ip_2_ip4_c(dest));
|
||||
return inet_chksum_pseudo_partial(p, proto, proto_len, chksum_len, ip_2_ip4(src), ip_2_ip4(dest));
|
||||
}
|
||||
#endif /* LWIP_IPV4 */
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ icmp6_input(struct pbuf *p, struct netif *inp)
|
||||
/* Determine reply source IPv6 address. */
|
||||
#if LWIP_MULTICAST_PING
|
||||
if (ip6_addr_ismulticast(ip6_current_dest_addr())) {
|
||||
reply_src = ip_2_ip6_c(ip6_select_source_address(inp, ip6_current_src_addr()));
|
||||
reply_src = ip_2_ip6(ip6_select_source_address(inp, ip6_current_src_addr()));
|
||||
if (reply_src == NULL) {
|
||||
/* drop */
|
||||
pbuf_free(p);
|
||||
@@ -323,7 +323,7 @@ icmp6_send_response(struct pbuf *p, u8_t code, u32_t data, u8_t type)
|
||||
reply_dest = ip6_current_src_addr();
|
||||
|
||||
/* Select an address to use as source. */
|
||||
reply_src = ip_2_ip6_c(ip6_select_source_address(netif, reply_dest));
|
||||
reply_src = ip_2_ip6(ip6_select_source_address(netif, reply_dest));
|
||||
if (reply_src == NULL) {
|
||||
/* drop */
|
||||
pbuf_free(q);
|
||||
|
||||
@@ -255,7 +255,7 @@ ip6_select_source_address(struct netif *netif, const ip6_addr_t * dest)
|
||||
else {
|
||||
/* Replace src only if we find a prefix match. */
|
||||
/* TODO find longest matching prefix. */
|
||||
if ((!(ip6_addr_netcmp(ip_2_ip6_c(src), dest))) &&
|
||||
if ((!(ip6_addr_netcmp(ip_2_ip6(src), dest))) &&
|
||||
ip6_addr_netcmp(netif_ip6_addr(netif, i), dest)) {
|
||||
src = netif_ip_addr6(netif, i);
|
||||
}
|
||||
@@ -817,7 +817,7 @@ ip6_output_if(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
|
||||
const ip6_addr_t *src_used = src;
|
||||
if (dest != IP_HDRINCL) {
|
||||
if (src != NULL && ip6_addr_isany(src)) {
|
||||
src = ip_2_ip6_c(ip6_select_source_address(netif, dest));
|
||||
src = ip_2_ip6(ip6_select_source_address(netif, dest));
|
||||
if ((src == NULL) || ip6_addr_isany(src)) {
|
||||
/* No appropriate source address was found for this packet. */
|
||||
LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip6_output: No suitable source address for packet.\n"));
|
||||
|
||||
@@ -329,7 +329,7 @@ raw_sendto(struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr)
|
||||
/* If requested, based on the IPV6_CHECKSUM socket option per RFC3542,
|
||||
compute the checksum and update the checksum in the payload. */
|
||||
if (PCB_ISIPV6(pcb) && pcb->chksum_reqd) {
|
||||
u16_t chksum = ip6_chksum_pseudo(p, pcb->protocol, p->tot_len, ip_2_ip6_c(src_ip), ip_2_ip6_c(dst_ip));
|
||||
u16_t chksum = ip6_chksum_pseudo(p, pcb->protocol, p->tot_len, ip_2_ip6(src_ip), ip_2_ip6(dst_ip));
|
||||
LWIP_ASSERT("Checksum must fit into first pbuf", p->len >= (pcb->chksum_offset + 2));
|
||||
SMEMCPY(((u8_t *)p->payload) + pcb->chksum_offset, &chksum, sizeof(u16_t));
|
||||
}
|
||||
|
||||
@@ -1803,7 +1803,7 @@ tcp_eff_send_mss_impl(u16_t sendmss, const ip_addr_t *dest
|
||||
#endif /* LWIP_IPV4 */
|
||||
{
|
||||
/* First look in destination cache, to see if there is a Path MTU. */
|
||||
mtu = nd6_get_destination_mtu(ip_2_ip6_c(dest), outif);
|
||||
mtu = nd6_get_destination_mtu(ip_2_ip6(dest), outif);
|
||||
}
|
||||
#if LWIP_IPV4
|
||||
else
|
||||
|
||||
@@ -666,7 +666,7 @@ udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_i
|
||||
#if LWIP_IPV6
|
||||
if (PCB_ISIPV6(pcb)) {
|
||||
if (ip6_addr_isany(ip_2_ip6(&pcb->local_ip))) {
|
||||
src_ip = ip6_select_source_address(netif, ip_2_ip6_c(dst_ip));
|
||||
src_ip = ip6_select_source_address(netif, ip_2_ip6(dst_ip));
|
||||
if (src_ip == NULL) {
|
||||
/* No suitable source address was found. */
|
||||
return ERR_RTE;
|
||||
|
||||
Reference in New Issue
Block a user