You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/26 14:00:41 UTC

[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #7431: net: move IPv4/6BUF define to common header

anchao commented on code in PR #7431:
URL: https://github.com/apache/incubator-nuttx/pull/7431#discussion_r1005724934


##########
net/igmp/igmp_send.c:
##########
@@ -104,7 +102,7 @@ static uint16_t igmp_chksum(FAR uint8_t *buffer, int buflen)
 void igmp_send(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group,
                FAR const in_addr_t *destipaddr, uint8_t msgid)
 {
-  FAR struct igmp_iphdr_s *ipv4 = IPv4BUF;
+  FAR struct igmp_iphdr_s *ipv4 = (FAR struct igmp_iphdr_s *)IPv4BUF;

Review Comment:
   Done



##########
net/igmp/igmp_input.c:
##########
@@ -115,7 +108,7 @@
 
 void igmp_input(struct net_driver_s *dev)
 {
-  FAR struct igmp_iphdr_s *ipv4 = IPv4BUF;
+  FAR struct igmp_iphdr_s *ipv4 = (FAR struct igmp_iphdr_s *)IPv4BUF;

Review Comment:
   Done



##########
net/icmpv6/icmpv6.h:
##########
@@ -52,6 +52,10 @@
 #define icmpv6_callback_free(dev, conn, cb) \
   devif_conn_callback_free((dev), (cb), &(conn)->sconn.list, &(conn)->sconn.list_tail)
 
+/* This is a helper pointer for accessing the contents of the IP header */
+
+#define ICMPv6BUF(hl) ((FAR void *)&dev->d_buf[NET_LL_HDRLEN(dev) + hl])

Review Comment:
   Done



##########
drivers/net/slip.c:
##########
@@ -111,8 +111,8 @@
 
 /* This is a helper pointer for accessing the contents of the ip header */
 
-#define IPv4BUF        ((FAR struct ipv4_hdr_s *)priv->dev.d_buf)
-#define IPv6BUF        ((FAR struct ipv6_hdr_s *)priv->dev.d_buf)
+#define SLIPIPv4BUF        ((FAR struct ipv4_hdr_s *)priv->dev.d_buf)
+#define SLIPIPv6BUF        ((FAR struct ipv6_hdr_s *)priv->dev.d_buf)

Review Comment:
   Done



##########
arch/arm/src/tiva/lm/lm3s_ethernet.c:
##########
@@ -675,10 +671,11 @@ static int tiva_txpoll(struct net_driver_s *dev)
 
 static void tiva_receive(struct tiva_driver_s *priv)
 {
+  struct net_driver_s *dev = &priv->ld_dev;
+  int      bytesleft;
+  int      pktlen;

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org