sflow / host-sflow

host-sflow agent
http://sflow.net
Other
146 stars 55 forks source link

The netlink message length should include the generic netlink header length. #44

Closed paulc11 closed 3 years ago

paulc11 commented 3 years ago

Please see implementation of function genlmsg_put of libnl.

paulc11 commented 3 years ago

Without the fix, the drop monitor HW drop will never be enabled. Since both sizeof(struct genlmsghdr) and sizeof( struct nlattr) are 4 bytes, Kernel will think the netlink message only has one attribute and will not take the second attribute.

Add some debug prints in kernel function net_dm_cmd_trace inside net/core/drop_monitor.c, you will see set_hw is false even if the host-sflow agent tries to enable it.

sflow commented 3 years ago

Merged. Thanks!