xiaoxiang781216 commented on code in PR #7768: URL: https://github.com/apache/nuttx/pull/7768#discussion_r1038951108
########## include/nuttx/net/netdev.h: ########## @@ -157,17 +157,12 @@ # define NETDEV_ERRORS(dev) #endif -/* There are some helper pointers for accessing the contents of the Ethernet - * headers - */ - -#define ETHBUF ((FAR struct eth_hdr_s *)&dev->d_buf[0]) - /* There are some helper pointers for accessing the contents of the IP * headers */ -#define IPBUF(hl) ((FAR void *)&dev->d_buf[NET_LL_HDRLEN(dev) + (hl)]) +#define IPBUF(hl) ((FAR void *)\ + &dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE + (hl)]) #define IPv4BUF ((FAR struct ipv4_hdr_s *)IPBUF(0)) #define IPv6BUF ((FAR struct ipv6_hdr_s *)IPBUF(0)) Review Comment: let's move IPv4BUF/IPv6BUF/IPBUF to private header file too. ########## net/arp/arp.h: ########## @@ -81,8 +81,10 @@ /* This is a helper pointer for accessing the contents of the IP header */ -#define ARPBUF ((FAR struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN]) -#define ARPIPBUF ((FAR struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN]) +#define ARPBUF ((FAR struct arp_hdr_s *)\ Review Comment: But no change -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org