Skip to content

[Bug]: Netlink library only parses the first RTM_NEWLINK message in a getLink() response. #459

@jglogan

Description

@jglogan

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

When linkGet() receives the data buffer from the netlink socket, it calls parseResponse() to create a list of LinkResponse objects, each of which has an interfaceIndex and a list of attributes.

The problem is that the parse function is only looking for a single message, instead of processing messages until all data is consumed.

Current behavior

For linkGet(interface: nil) get one RTM_NEWLINK for the first interface, and the data for the remaining interfaces looks like a large final attribute with type 0. Only a single LinkResult is returned.

Expected behavior

The linkGet(interface: nil) call should return a LinkResult for each interface.

Environment

- OS: 26
- Xcode: 26
- Swift: 6.2

Relevant log output

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

networknextItems in scope for the next few milestones

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions