This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 1c481ecb5030584c3e7f24136859223d45b7a36c Author: Marco Casaroli <[email protected]> AuthorDate: Thu Nov 19 12:37:38 2026 +0100 net/procfs: Count the lines of a device file in 16 bits. netprocfs_read_linegen() counted the lines of /proc/net/<device> in netprocfs_file_s.lineno, a uint8_t, and stopped when it reached the number of line generators. With CONFIG_NETDEV_MULTIPLE_IPv6 there is one generator for each IPv6 address, so a CONFIG_NETDEV_MAX_IPv6_ADDR near its limit of 255 (246 or more with IPv4 and CONFIG_NETDEV_STATISTICS) gives more than 255 generators: the count wrapped before it got there and a read of the file never ended. The count is now a uint16_t, wider than the largest number of generators. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- net/procfs/procfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/procfs/procfs.h b/net/procfs/procfs.h index 45166a50b6c..c8931afed12 100644 --- a/net/procfs/procfs.h +++ b/net/procfs/procfs.h @@ -59,7 +59,7 @@ struct netprocfs_file_s { struct procfs_file_s base; /* Base open file structure */ FAR struct net_driver_s *dev; /* Current network device */ - uint8_t lineno; /* Line number */ + uint16_t lineno; /* Line number */ uint8_t linesize; /* Number of valid characters in line[] */ uint8_t offset; /* Offset to first valid character in line[] */ uint8_t entry; /* Entry index of netprocfs_entry_s */
