[BUG] Socket option renumbering in #20713 breaks Rust's libc
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- networking
Hướng nghiên cứu
Start by comparing the socket option constants in Rust's src/unix/nuttx/mod.rs with the NuttX master headers, as the report identifies 29 mismatches after #20713. Read that change and trace the affected socket options, including the TCP/IP/IPv6 values built on them. Determine whether NuttX should preserve the existing ABI values or coordinate a Rust libc update; done means the chosen numbering is consistent and the reported Rust networking calls work.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description / Steps to reproduce the issue
#20713 renumbered the SOL_SOCKET options and moved __SO_PROTOCOL from 16 to 11, which also shifts the TCP/IP/IPv6 options built on top of it. Rust's libc hardcodes these values for NuttX (src/unix/nuttx/mod.rs) and still has the 13.1.0 ones, so Rust networking will break with the next release.
I diffed every constant in Rust's nuttx/mod.rs against the master headers (sim:nsh). 29 of them don't match, and all are socket options, e.g.:
rust master
SO_REUSEADDR 11 0
SO_ERROR 4 69
SO_RCVBUF 8 64
SO_SNDBUF 12 66
SO_SNDTIMEO 14 11
TCP_NODELAY 16 11
IP_TTL 30 25
IPV6_V6ONLY 23 18
The worst one is TcpListener::bind: Rust std always sets SO_REUSEADDR (11) first, and 11 is now SO_SNDTIMEO, which wants a struct timeval. I checked with a small C program on sim:tcploop using Rust's numbers:
rust SO_REUSEADDR(11): ret=-1 errno=22
rust SO_ERROR(4): ret=-1 errno=92
rust TCP_NODELAY(16): ret=-1 errno=38 (16 is TCP_CORK now)
So any Rust TCP server fails at bind, and set_nodelay / take_error fail too.
Should we keep the new numbering and fix Rust's libc (and say so in the release notes), or keep these values stable since they're user-facing ABI? Happy to send the libc PR either way.
On which OS does this issue occur?
[OS: Linux]
What is the version of your OS?
Ubuntu, kernel 7.0
NuttX Version
master (after #20713)
Issue Architecture
[Arch: all]
Issue Area
[Area: Networking]
Host information
No response
Verification
- I have verified before submitting the report.
- Ngôn ngữ chính
- C
- Star
- 4.1k
- Fork
- 1.8k
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 833
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/nuttx
-
Please rerun `pre-commit run -a`Đang mởArch: all Arch: arm Area: Build system OS: Linux Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/nuttx#19435 · 9 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Arch: all OS: Linux Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
apache/nuttx#16249 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
apache/nuttx#21581 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Arch: simulator Arch: xtensa Area: Kernel OS: Mac Type: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
apache/nuttx#21499 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
SPIDevice selects an active-high device as soon as it is createdCó thể đã có người làm @mikeysklar đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
adafruit/circuitpython#11869 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
gnif/LookingGlass#1352 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
kovidgoyal/kitty#10862 ·
Maintainer thường phản hồi trong vòng 1 ngày