You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "anchao (via GitHub)" <gi...@apache.org> on 2023/02/07 08:19:53 UTC
[GitHub] [nuttx] anchao opened a new pull request, #8451: net/ip: fix compile break if disable NET_TCP
anchao opened a new pull request, #8451:
URL: https://github.com/apache/nuttx/pull/8451
## Summary
net/ip: fix compile break if disable NET_TCP
1.
```bash
ipfrag/ipv4_frag.c: In function ‘ipv4_fragin’:
ipfrag/ipv4_frag.c:184:22: warning: ‘head’ may be used uninitialized in this function [-Wmaybe-uninitialized]
184 | ipv4->len[1] = head->io_pktlen & 0xff;
| ~~~~^~~~~~~~~~~
ipfrag/ipv4_frag.c:123:21: note: ‘head’ was declared here
123 | FAR struct iob_s *head;
| ^~~~
```
2.
```bash
devif/ipv6_input.c: In function ‘ipv6_in’:
devif/ipv6_input.c:60:33: error: ‘TCPIPv6BUF’ undeclared (first use in this function); did you mean ‘UDPIPv6BUF’?
60 | #define PAYLOAD ((FAR uint8_t *)TCPIPv6BUF)
| ^~~~~~~~~~
```
3.
```bash
nat/ipv4_nat.c: In function ‘ipv4_nat_inbound_icmp’: nat/ipv4_nat.c:67:30: error: ‘TCP_HDRLEN’ undeclared (first use in this function); did you mean ‘UDP_HDRLEN’?
67 | ((proto) == IP_PROTO_TCP ? TCP_HDRLEN : \
| ^~~~~~~~~~
nat/ipv4_nat.c:323:47: note: in expansion of macro ‘L4_HDRLEN’
323 | inner_l4hdrlen = MIN(inner_l4len, L4_HDRLEN(inner->proto));
| ^~~~~~~~~
```
Signed-off-by: chao an <an...@xiaomi.com>
## Impact
N/A
## Testing
disable CONFIG_NET_TCP
--
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
[GitHub] [nuttx] anchao commented on pull request #8451: net/ip: fix compile break if disable NET_TCP
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on PR #8451:
URL: https://github.com/apache/nuttx/pull/8451#issuecomment-1420646285
> @anchao maybe it is reasonable to add some configuration to the code tree, so CI can catch a build break like this?
Yes, I added some rare config, please review https://github.com/apache/nuttx/pull/8455
--
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
[GitHub] [nuttx] pkarashchenko merged pull request #8451: net/ip: fix compile break if disable NET_TCP
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko merged PR #8451:
URL: https://github.com/apache/nuttx/pull/8451
--
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
[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #8451: net/ip: fix compile break if disable NET_TCP
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #8451:
URL: https://github.com/apache/nuttx/pull/8451#discussion_r1098330428
##########
net/nat/ipv4_nat.c:
##########
@@ -88,6 +84,44 @@ ipv4_nat_outbound_internal(FAR struct net_driver_s *dev,
FAR struct ipv4_hdr_s *ipv4,
enum nat_manip_type_e manip_type);
+/****************************************************************************
+ * Inline Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: ipv4_nat_l4_hdrlen
+ *
+ * Description:
+ * Get L4 header length
+ *
+ ****************************************************************************/
+
+static inline uint16_t ipv4_nat_l4_hdrlen(uint8_t proto)
+{
+#ifdef CONFIG_NET_TCP
Review Comment:
Maybe better to reorganise in switch/case and debug assert in default?
--
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
[GitHub] [nuttx] anchao commented on a diff in pull request #8451: net/ip: fix compile break if disable NET_TCP
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #8451:
URL: https://github.com/apache/nuttx/pull/8451#discussion_r1098342220
##########
net/nat/ipv4_nat.c:
##########
@@ -88,6 +84,44 @@ ipv4_nat_outbound_internal(FAR struct net_driver_s *dev,
FAR struct ipv4_hdr_s *ipv4,
enum nat_manip_type_e manip_type);
+/****************************************************************************
+ * Inline Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: ipv4_nat_l4_hdrlen
+ *
+ * Description:
+ * Get L4 header length
+ *
+ ****************************************************************************/
+
+static inline uint16_t ipv4_nat_l4_hdrlen(uint8_t proto)
+{
+#ifdef CONFIG_NET_TCP
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
[GitHub] [nuttx] pkarashchenko commented on pull request #8451: net/ip: fix compile break if disable NET_TCP
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on PR #8451:
URL: https://github.com/apache/nuttx/pull/8451#issuecomment-1420568567
@anchao maybe it is reasonable to add some configuration to the code tree, so CI can catch a build break like this?
--
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