xiaoxiang781216 commented on code in PR #7616: URL: https://github.com/apache/nuttx/pull/7616#discussion_r1032763656
########## include/nuttx/net/ip.h: ########## @@ -229,6 +229,51 @@ extern "C" * Public Function Prototypes ****************************************************************************/ +/**************************************************************************** + * Name: net_iphdrsize + * + * Description: + * Return the size of the IP header + * + * Input Parameters: + * domain - IP domain: PF_INET or PF_INET6 + * l4size - L4 additional header size + * + * Returned Value: + * The size of the combined L3 + L4 headers is returned. + * + ****************************************************************************/ + +static inline uint16_t net_iphdrsize(uint8_t domain, uint16_t l4size) Review Comment: let's change to macro: domain == PF_INET ? sizeof(struct ipv4_hdr_s) + l4size : sizeof(struct ipv6_hdr_s) + l4size; ########## net/Kconfig: ########## @@ -117,6 +117,15 @@ config NET_GUARDSIZE packet size will be chopped down to the size indicated in the TCP header. +config NET_LL_GRUARDSIZE + int "Data Link Layer(L2) Guard size of Network buffer(IOB)" + default 14 if NET_ETHERNET + default 16 Review Comment: why not use the same value? -- 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