We want to check the size of the header, not a pointer to it.
Details
Details
- Reviewers
melifaro markj - Group Reviewers
network - Commits
- rGbbe6559cf958: netlink: fix size comparison
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/netlink/netlink_generic.c | ||
---|---|---|
70–71 | It's nicer IMO to use sizeof(*hdr), although netlink is inconsistent about this. |
sys/netlink/netlink_generic.c | ||
---|---|---|
70–71 | I personally prefer sizeof(type) when coding protocols that exchange data, cause a protocol specification talks about types not about our local variable names. That makes it easier to check that code follow protocol spec. For other cases I prefer sizeof(*var), cause var type may change, and often does. |