ethnl_put_strz(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ethnl_put_strz(9) β€” the Kernel API Manual

ok so bestie, we're in the Kernel API Manual today and this little function is genuinely iconic. it's ethnl_put_strz and it's giving "i put a string in a message" energy. yes it's a whole vibe. no cap.


✨ SYNOPSIS ✨

int ethnl_put_strz (struct sk_buff *skb , u16 attrtype , const char *s );

that's it. three args, one int coming back. slay.


πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” the skb that's holding the message πŸ‘‘ this is the whole context, ok, don't lose it.
  • attrtype β€” the attribute type. literally just which attribute we're talking about 🏷️
  • s β€” a string that's ETH_GSTRING_LEN sized. and bestie, heads up: it may not be null terminated 😭 read that again. it's not guaranteed to have that little \0 at the end.

πŸ¦‹ DESCRIPTION πŸ¦‹

it puts an attribute into the message β€” one with a null terminated string made from s. so like, the attribute you get out there is null terminated, even if s wasn't. that's the glow-up fr fr ✨


πŸ”₯ RETURN πŸ”₯

  • 0 on success β€” we ate πŸ’…
  • a negative error code on failure β€” something went wrong, cry about it 😭

🌸 friendly reminder: s is ETH_GSTRING_LEN sized and may not be null terminated, so don't go assuming things about it. that's the whole point of this function existing, iykyk.

🌈 SEE ALSO 🌈

Kernel file ./net/ethtool/netlink.h plus the whole friend group:


ok that's the whole page, ily, go write some netlink attributes πŸ’–

this masterpiece lives in ./net/ethtool, dated October 2026, and it's part of the Kernel API Manual β€” see u next time bestie πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from