Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/ip: fix compile break if disable NET_TCP #8451

Merged
merged 2 commits into from Feb 7, 2023

Conversation

anchao
Copy link
Contributor

@anchao anchao commented Feb 7, 2023

Summary

net/ip: fix compile break if disable NET_TCP

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;
      |                     ^~~~
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)
      |                                 ^~~~~~~~~~
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));
      |                                               ^~~~~~~~~
net/slip.c:865:29: warning: unused variable ‘priv’ [-Wunused-variable]
  865 |   FAR struct slip_driver_s *priv =
      |                             ^~~~
net/slip.c: In function ‘slip_rmmac’:
net/slip.c:895:29: warning: unused variable ‘priv’ [-Wunused-variable]
  895 |   FAR struct slip_driver_s *priv =
      |                             ^~~~
local/local_sendmsg.c: In function ‘local_sendmsg’:
local/local_sendmsg.c:423:18: warning: ‘count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  423 |           return count;
      |                  ^~~~~
local/local_sendmsg.c:131:11: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  131 |   while (i-- > 0)
      |          ~^~
local/local_sendmsg.c:71:7: note: ‘i’ was declared here
   71 |   int i;
      |       ^

Signed-off-by: chao an anchao@xiaomi.com

Impact

N/A

Testing

disable CONFIG_NET_TCP

net/nat/ipv4_nat.c Outdated Show resolved Hide resolved
1.
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.
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.
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 <anchao@xiaomi.com>
1.
net/slip.c:865:29: warning: unused variable ‘priv’ [-Wunused-variable]
  865 |   FAR struct slip_driver_s *priv =
      |                             ^~~~
net/slip.c: In function ‘slip_rmmac’:
net/slip.c:895:29: warning: unused variable ‘priv’ [-Wunused-variable]
  895 |   FAR struct slip_driver_s *priv =
      |                             ^~~~
2.
local/local_sendmsg.c: In function ‘local_sendmsg’:
local/local_sendmsg.c:423:18: warning: ‘count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  423 |           return count;
      |                  ^~~~~
local/local_sendmsg.c:131:11: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  131 |   while (i-- > 0)
      |          ~^~
local/local_sendmsg.c:71:7: note: ‘i’ was declared here
   71 |   int i;
      |       ^

Signed-off-by: chao an <anchao@xiaomi.com>
@pkarashchenko pkarashchenko merged commit 1cb1196 into apache:master Feb 7, 2023
@pkarashchenko
Copy link
Contributor

@anchao maybe it is reasonable to add some configuration to the code tree, so CI can catch a build break like this?

@anchao
Copy link
Contributor Author

anchao commented Feb 7, 2023

@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 #8455

@jerpelea jerpelea added this to To-Add in Release Notes - 12.1.0 Apr 3, 2023
@jerpelea jerpelea moved this from To-Add to Added in Release Notes - 12.1.0 Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants