0

The libnl library provides functions like nla_put_...(...) for adding attributes to a netlink message. Can I somehow rewrite certain attribute without recreating the whole message? Didn't found any interface function in libnl fot doing this.

Thanks.

  • Please provide enough code so others can better understand or reproduce the problem. – Community Oct 20 '21 at 16:46
  • Do you mean overwrite the attribute value? – Vencat Oct 25 '21 at 19:41
  • @Vencat yes, i mean overwrite the value without changing attribute's type – Аркадий Oct 27 '21 at 12:14
  • what happens if you call the same function again with the same message, same attribute but with a different value? for example, nla_put_u8(msg, ATTR_INT, 2); nla_put_u8(msg, ATTR_INT, 4); // now it's overwritten isn't it ? – Vencat Oct 27 '21 at 14:20
  • @Vencat no, this function simply allocates memory and writes attribute header and value. It doesn’t check if attribute already exists. Check the source code – Аркадий Oct 27 '21 at 17:31

0 Answers0