<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git, branch lr/th/tc</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>platform: fix build for missing &lt;linux/tc_act/tc_defact.h&gt; header</title>
<updated>2017-12-11T09:30:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-12-11T08:42:14+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/commit/?id=e40114d356c4c0b0e24ba5d391cdfb24aa355c55'/>
<id>e40114d356c4c0b0e24ba5d391cdfb24aa355c55</id>
<content type='text'>
&lt;linux/tc_act/tc_defact.h&gt; was moved to user-space API only in 2013
by commit 5bc3db5c9ca8407f52918b6504d3b27230defedc. Our travis CI currently
fails to build due to that.

Re-implement the header.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
&lt;linux/tc_act/tc_defact.h&gt; was moved to user-space API only in 2013
by commit 5bc3db5c9ca8407f52918b6504d3b27230defedc. Our travis CI currently
fails to build due to that.

Re-implement the header.
</pre>
</div>
</content>
</entry>
<entry>
<title>libnm: validate NMTCAction.kind and make it a static string</title>
<updated>2017-12-11T09:30:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-12-10T20:30:22+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/commit/?id=7d044a3ef7c868b47a80f58ee923c35e7fd3f1fd'/>
<id>7d044a3ef7c868b47a80f58ee923c35e7fd3f1fd</id>
<content type='text'>
tc_commit() cannot just do
  tfilter-&gt;action.kind = nm_tc_action_get_kind (action);
because (previously), the lifetime of nm_tc_action_get_kind()
is not guaranteed to exceed the lifetime of the tfilter
instance. Or at least, it is not obvious, that it does.

tfilter-&gt;action.kind can only be set to a static string,
because NMPlatformTfilter has not implemented a way to
manage the lifetime of the strings. For that, it would need
to implement cmd_obj_copy().

But platform anyway needs to craft a netlink message based
on the action kind. The kind is not an opaque string. Its
value must be understood at least by platform to create
the action. Hence, also libnm-core can just as well know the
valid kinds and it can reject invalid ones.

Thus, let's not dynamically allocate the string for kind
but make it a static string. This can be copied around without
danger for the lifeimte of the strings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tc_commit() cannot just do
  tfilter-&gt;action.kind = nm_tc_action_get_kind (action);
because (previously), the lifetime of nm_tc_action_get_kind()
is not guaranteed to exceed the lifetime of the tfilter
instance. Or at least, it is not obvious, that it does.

tfilter-&gt;action.kind can only be set to a static string,
because NMPlatformTfilter has not implemented a way to
manage the lifetime of the strings. For that, it would need
to implement cmd_obj_copy().

But platform anyway needs to craft a netlink message based
on the action kind. The kind is not an opaque string. Its
value must be understood at least by platform to create
the action. Hence, also libnm-core can just as well know the
valid kinds and it can reject invalid ones.

Thus, let's not dynamically allocate the string for kind
but make it a static string. This can be copied around without
danger for the lifeimte of the strings.
</pre>
</div>
</content>
</entry>
<entry>
<title>all: make simple action's "sdata" string</title>
<updated>2017-12-11T09:30:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-12-11T07:37:59+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/commit/?id=0c0ff4809982ddca61a470de196fe1b4132d187f'/>
<id>0c0ff4809982ddca61a470de196fe1b4132d187f</id>
<content type='text'>
For kernel, the sdata is a NUL terminated string. Very much like
file names or interface names or basically everything, kernel
is agnostic to any encoding. Of course, that is just lazy and leaves
user space in an impossible situation. User space rightly wants to
treat these fields as strings, show them in a UI, and read them
from command line options (like, the terminal should display
characters according to a certain encoding, not just show �).
But once a text is converted to a bunch of bytes, it only makes
sense if you know the text encoding that is used. But as kernel does
not restrict the encoding in any way (except requiring NUL termination,
and in case of file names special treatment of '.' and '/' -- ASCII
encoded), user space cannot reliably convert the blob back into a string.

Still, overall we don't want to treat such strings as blobs. In most
cases, users are sensible enough to just set them to ASCII or at most
UTF-8 encoding. So, treating them as UTF-8 strings is a good choice.

Change the attribute type of "sdata" from bytestring to string for
that, but make a special exception: this string is not taken literally,
instead it is a backslash encoded UTF-8 string.

That means, in most of the cases, the user can just treat it as
a regular string. Except that he must take special care of backslash.
But it still gives the user the possibility to encode every binary
value in this string using backslash escaping.

The escaped value can be created with nm_utils_str_utf8safe_escape()
or g_strescape() and converted back via nm_utils_str_utf8safe_unescape()
or g_strcompress().

Also, the attributes are not verified. Before accessing them in
tc_commit(), check that the attribute has the expected type.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For kernel, the sdata is a NUL terminated string. Very much like
file names or interface names or basically everything, kernel
is agnostic to any encoding. Of course, that is just lazy and leaves
user space in an impossible situation. User space rightly wants to
treat these fields as strings, show them in a UI, and read them
from command line options (like, the terminal should display
characters according to a certain encoding, not just show �).
But once a text is converted to a bunch of bytes, it only makes
sense if you know the text encoding that is used. But as kernel does
not restrict the encoding in any way (except requiring NUL termination,
and in case of file names special treatment of '.' and '/' -- ASCII
encoded), user space cannot reliably convert the blob back into a string.

Still, overall we don't want to treat such strings as blobs. In most
cases, users are sensible enough to just set them to ASCII or at most
UTF-8 encoding. So, treating them as UTF-8 strings is a good choice.

Change the attribute type of "sdata" from bytestring to string for
that, but make a special exception: this string is not taken literally,
instead it is a backslash encoded UTF-8 string.

That means, in most of the cases, the user can just treat it as
a regular string. Except that he must take special care of backslash.
But it still gives the user the possibility to encode every binary
value in this string using backslash escaping.

The escaped value can be created with nm_utils_str_utf8safe_escape()
or g_strescape() and converted back via nm_utils_str_utf8safe_unescape()
or g_strcompress().

Also, the attributes are not verified. Before accessing them in
tc_commit(), check that the attribute has the expected type.
</pre>
</div>
</content>
</entry>
<entry>
<title>core/trivial: rename NMPlatformActionSimple sdata field</title>
<updated>2017-12-11T09:30:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-12-11T07:20:24+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/commit/?id=cd242e1245a3602168db7a505603b41ca622544b'/>
<id>cd242e1245a3602168db7a505603b41ca622544b</id>
<content type='text'>
Kernel calls this TCA_DEF_DATA, defdata, and tcfd_defdata.
iproute2 calls it in command line "sdata", and in code "simpdata".
libnm calls it simply "sdata".

"str" is not a good name.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Kernel calls this TCA_DEF_DATA, defdata, and tcfd_defdata.
iproute2 calls it in command line "sdata", and in code "simpdata".
libnm calls it simply "sdata".

"str" is not a good name.
</pre>
</div>
</content>
</entry>
<entry>
<title>platform: use NLA_PUT_STRING() for simple action's data</title>
<updated>2017-12-11T09:30:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-12-10T20:27:51+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/commit/?id=6680b4867a7428c4b5483a34177701980d7862dc'/>
<id>6680b4867a7428c4b5483a34177701980d7862dc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>platform: fix TC to-string/hash/cmp functions to include the action</title>
<updated>2017-12-11T09:30:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-12-10T11:52:41+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/commit/?id=e46a97294fe46264ddfaec1242805b5d815ccf93'/>
<id>e46a97294fe46264ddfaec1242805b5d815ccf93</id>
<content type='text'>
Also add a define NM_PLATFORM_ACTION_KIND_SIMPLE. It makes the
uses of "simple" grepable.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also add a define NM_PLATFORM_ACTION_KIND_SIMPLE. It makes the
uses of "simple" grepable.
</pre>
</div>
</content>
</entry>
<entry>
<title>libnm: sort attribute names in nm_tc_action_get_attribute_names()</title>
<updated>2017-12-11T09:30:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-12-10T11:20:38+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/commit/?id=0e2d403f57c2f9ccc9fbfaaaeb73644704737b55'/>
<id>0e2d403f57c2f9ccc9fbfaaaeb73644704737b55</id>
<content type='text'>
The order in which the attribute names are returns should
be defined and stable. Sort them and re-use the helper functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The order in which the attribute names are returns should
be defined and stable. Sort them and re-use the helper functions.
</pre>
</div>
</content>
</entry>
<entry>
<title>libnm: consider attributes in nm_tc_action_equal()</title>
<updated>2017-12-11T09:30:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-12-10T11:43:34+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/commit/?id=4d05baaeb8719b5dab682bef7e690f2f2429400f'/>
<id>4d05baaeb8719b5dab682bef7e690f2f2429400f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libnm: sort attribute names in nm_ip_address_get_attribute_names()</title>
<updated>2017-12-11T09:30:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-12-10T11:20:38+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/commit/?id=0e6bbad454c1c4d9cd619942b7b7e10eb7771c06'/>
<id>0e6bbad454c1c4d9cd619942b7b7e10eb7771c06</id>
<content type='text'>
The order in which the attribute names are returns should
be defined and stable. Sort them and re-use the helper functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The order in which the attribute names are returns should
be defined and stable. Sort them and re-use the helper functions.
</pre>
</div>
</content>
</entry>
<entry>
<title>libnm: use nm_utils_strdict_get_keys() for getting attribute-names of ip-routes</title>
<updated>2017-12-11T09:30:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-12-10T11:20:38+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/NetworkManager.git/commit/?id=0e82971b5335d62bb8f3ba8c6bb4dd2d63f333fa'/>
<id>0e82971b5335d62bb8f3ba8c6bb4dd2d63f333fa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
