-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
In br_set_state() the port state is passed in as a u8 and the attribute is added to the netlink message with the following line:
addattr32(&req.n, sizeof(req.buf), IFLA_PROTINFO, state);
In the kernel: net/bridge/br_netlink.c -> br_rtm_setlink()
The port state is grabbed using:
new_state = nla_get_u8(protinfo);
if (new_state > BR_STATE_BLOCKING)
return -EINVAL;
I was seeing the port state always being returned as zero.
In br_set_state() I changed to:
addattr_l(&req.n, sizeof(req.buf), IFLA_PROTINFO, &state, 1);
To only add the port state as one byte to the netlink message which corrected the problem and the kernel correctly received change of port states.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels