libnl++: add new func to send raw data with len
Some netlink attrib does not ending with null char.
Currently req.add string will always sending ending null character.
Add a new func called addBuffer that does not send ending null
character.
Bug: 238794143
Test: build, manual test
Change-Id: If51380cab95b2ae725673301b429b9e9889c5b0a
diff --git a/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp b/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
index 4c5b309..2d3b417 100644
--- a/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
+++ b/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
@@ -60,7 +60,7 @@
{
auto linkinfo = req.addNested(IFLA_LINKINFO);
- req.add(IFLA_INFO_KIND, type);
+ req.addBuffer(IFLA_INFO_KIND, type);
}
nl::Socket sock(NETLINK_ROUTE);