<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div>Two comments inline below.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 5, 2024 at 12:50 PM <<a href="mailto:berndmoessner80@gmail.com">berndmoessner80@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Bernd Moessner <<a href="mailto:berndmoessner80@gmail.com" target="_blank">berndmoessner80@gmail.com</a>><br>
<br>
The compiler issues a couple of warnings as the Xilinx code omits to cast pointers ip_addr_t to<br>
the required ip4_addr_t or ip6_addr_t tpye.<br>
<br>
Note, ip_addr_t can hold ip4_addr_t and ip6_addr_t. Therefore, the complaints by GCC are correct, but<br>
do not indicate a major bug.<br>
---<br>
.../contrib/ports/xilinx/netif/xemacpsif.c | 37 +++++++++++++++++++<br>
1 file changed, 37 insertions(+)<br>
<br>
diff --git a/embeddedsw/ThirdParty/sw_services/lwip211/src/contrib/ports/xilinx/netif/xemacpsif.c b/embeddedsw/ThirdParty/sw_services/lwip211/src/contrib/ports/xilinx/netif/xemacpsif.c<br>
index 1bf3abb..70c72ee 100644<br>
--- a/embeddedsw/ThirdParty/sw_services/lwip211/src/contrib/ports/xilinx/netif/xemacpsif.c<br>
+++ b/embeddedsw/ThirdParty/sw_services/lwip211/src/contrib/ports/xilinx/netif/xemacpsif.c<br>
@@ -61,14 +61,24 @@<br>
<br>
#if LWIP_IGMP<br>
static err_t xemacpsif_mac_filter_update (struct netif *netif,<br>
+#ifndef __rtems__<br>
ip_addr_t *group, u8_t action);<br>
+#else /* __rtems__ */<br>
+ const ip4_addr_t *group,<br>
+ enum netif_mac_filter_action action);<br>
+#endif<br>
<br>
static u8_t xemacps_mcast_entry_mask = 0;<br>
#endif<br>
<br>
#if LWIP_IPV6 && LWIP_IPV6_MLD<br>
static err_t xemacpsif_mld6_mac_filter_update (struct netif *netif,<br>
+#ifndef __rtems__<br>
ip_addr_t *group, u8_t action);<br>
+#else /* __rtems__ */<br>
+ const ip6_addr_t *group,<br>
+ enum netif_mac_filter_action action);<br>
+#endif<br>
<br>
static u8_t xemacps_mld6_mcast_entry_mask;<br>
#endif<br>
@@ -236,10 +246,18 @@ static struct pbuf * low_level_input(struct netif *netif)<br>
*/<br>
<br>
static err_t xemacpsif_output(struct netif *netif, struct pbuf *p,<br>
+#ifndef __rtems__<br>
const ip_addr_t *ipaddr)<br>
+#else /* __rtems__ */<br>
+ const ip4_addr_t *ipaddr)<br>
+#endif<br>
{<br>
/* resolve hardware address, then send (or queue) packet */<br>
+#ifndef __rtems__<br>
return etharp_output(netif, p, ipaddr);<br>
+#else /* __rtems__ */<br>
+ return etharp_output(netif, p, (const ip4_addr_t*) ipaddr);<br>
+#endif<br></blockquote><div><br></div><div>This change should not be necessary since the function signature above is changing.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
}<br>
<br>
/*<br>
@@ -514,7 +532,11 @@ static u8_t xemacpsif_ip6_addr_ismulticast(ip6_addr_t* ip_addr)<br>
}<br>
<br>
static void xemacpsif_mld6_mac_hash_update (struct netif *netif, u8_t *ip_addr,<br>
+#ifndef __rtems__<br>
u8_t action)<br>
+#else /* __rtems__ */<br>
+ enum netif_mac_filter_action action)<br>
+#endif<br>
{<br>
u8_t multicast_mac_addr[6];<br>
struct xemac_s *xemac = (struct xemac_s *) (netif->state);<br>
@@ -557,14 +579,24 @@ static void xemacpsif_mld6_mac_hash_update (struct netif *netif, u8_t *ip_addr,<br>
SYS_ARCH_UNPROTECT(lev);<br>
}<br>
<br>
+#ifndef __rtems__<br>
static err_t xemacpsif_mld6_mac_filter_update (struct netif *netif, ip_addr_t *group,<br>
u8_t action)<br>
+#else /* __rtems__ */<br>
+static err_t xemacpsif_mld6_mac_filter_update (struct netif *netif,<br>
+ const ip6_addr_t *group,<br>
+ enum netif_mac_filter_action action)<br>
+#endif<br>
{<br>
u8_t temp_mask;<br>
unsigned int i;<br>
u8_t * ip_addr = (u8_t *) group;<br>
<br>
+#ifndef __rtems__<br>
if(!(xemacpsif_ip6_addr_ismulticast((ip6_addr_t*) ip_addr))) {<br>
+#else /* __rtems__ */<br>
+ if(!(xemacpsif_ip6_addr_ismulticast((ip6_addr_t*) group ))) {<br>
+#endif<br></blockquote><div><br></div><div>It's better to change the function signature of xemacpsif_ip6_addr_ismulticast to take a const instead of casting away constness here since all its uses of the variable are macros that do not modify it. Once xemacpsif_ip6_addr_ismulticast takes a const, the cast becomes unnecessary.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
LWIP_DEBUGF(NETIF_DEBUG,<br>
("%s: The requested MAC address is not a multicast address.\r\n", __func__)); LWIP_DEBUGF(NETIF_DEBUG,<br>
("Multicast address add operation failure !!\r\n"));<br>
@@ -620,8 +652,13 @@ static err_t xemacpsif_mld6_mac_filter_update (struct netif *netif, ip_addr_t *g<br>
#endif<br>
<br>
#if LWIP_IGMP<br>
+#ifndef __rtems__<br>
static void xemacpsif_mac_hash_update (struct netif *netif, u8_t *ip_addr,<br>
u8_t action)<br>
+#else /* __rtems__ */<br>
+static void xemacpsif_mac_hash_update (struct netif *netif, u8_t *ip4_addr_t,<br>
+ enum netif_mac_filter_action action)<br>
+#endif<br>
{<br>
u8_t multicast_mac_addr[6];<br>
struct xemac_s *xemac = (struct xemac_s *) (netif->state);<br>
-- <br>
2.34.1<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>