Age | Commit message (Collapse) | Author |
|
|
|
Throughout the tree there's spurious use of spaces separating ++ and --
operators from their respective operands. Make ++ and -- operator
consistent with the majority of existing uses; discard the spaces.
|
|
The iftype is an unsigned short, and not just an unsigned.
|
|
as such
|
|
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file.
|
|
actually verify it
|
|
Fixes: #2338
|
|
networkd: Add support to configure VXLAN Port
|
|
Now we dont have any public API that will support
any size . sd_netlink_message_append_data will support
this.
|
|
|
|
nl->fd can be 0.
|
|
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008.
|
|
This is a continuation of the previous include sort patch, which
only sorted for .c files.
|
|
Sort the includes accoding to the new coding style.
|
|
Add a few includes that we rely on to be include already.
|
|
|
|
This way we do not rely on the size MAX* constants from the kernel headers, as these will
be out-of-sync in case we have old headers and new defines in missing.h.
|
|
|
|
|
|
|
|
socket-util.[ch]
|
|
|
|
There are more than enough to deserve their own .c file, hence move them
over.
|
|
string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files.
|
|
Track the number of matches installed for a given multicast group, and leave the
group once no matches depend on it.
In order to handle passed-in sockets that are already members of multicast groups
we initialize the refcount based on the membership once we take over the socket.
This way we will leave the socket in the state we found it once we finish with
it.
On kernels that do not fully support reading out the multicast group membership
we fall back to never leaving any groups (as before).
|
|
Also, explicitly don't support subscribing to GET or SET messages, as these will
never be emitted by the kernel.
|
|
|
|
By default we set as NLM_F_CREATE | NLM_F_EXCL in
sd_rtnl_message_new_link
But incase of bridge we need to set NLM_F_REQUEST | NLM_F_ACK.
If NLM_F_EXCL is set then we are unable to set the parameters. As bridge
supports setting properties after creation not during creation.
|
|
Rename rtnl_link_info_data_bridge_types to
rtnl_link_bridge_management_types
as they are of nested types of IFLA_AF_SPEC.
|
|
Let's also clean up single-line while and for blocks.
|
|
Patch via coccinelle.
|
|
This replaces this:
free(p);
p = NULL;
by this:
p = mfree(p);
Change generated using coccinelle. Semantic patch is added to the
sources.
|
|
This is a follow-up to #907, and makes the same change for all our other
public APIs.
|
|
The m->n_containers is index and has to be smaller than the array
size.
|
|
Pretty trivial helper which wraps free() but returns NULL, so we can
simplify this:
free(foobar);
foobar = NULL;
to this:
foobar = mfree(foobar);
|
|
|
|
NETLINK_TYPE_FLAG is NLA_FLAG.
This new type will be used in NLA_FLAG for example
IFLA_VXLAN_GBP and IFLA_VXLAN_REMCSUM_NOPARTIAL
|
|
|
|
|
|
Follow up for v222-124-g79e27dbcb1.
|
|
|
|
|
|
|
|
This merges:
sd-netlink: respect attribute type flags
..fixing a conflict due to a typo fix.
|
|
|
|
Though currently unused by us, netlink attribute types support embedding flags to indicate
if the type is encoded in network byte-order and if it is a nested attribute. Read out
these flags when parsing the message.
We will now swap the byteorder in case it is non-native when reading out integers (though
this is not needed by any of the types we currently support). We do not enforce the NESTED
flag, as the kernel gets this wrong in many cases.
|
|
This was a left-over from before we supported containers.
|
|
Instead of representing containers as several arrays, make a new
netlink_container struct and keep one array of these structs. We
also introduce netlink_attribute structs that in the future will
hold meta-information about each atribute.
|
|
Also rename from rtnl_* to netlink_*.
|
|
This was an oversight, they are no different from regular containers in this respect.
|