| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
So far we only supported selecting them by sibling attributes.
(This stuff is all a bit crazy, but there seems to be no other way...)
|
| |
|
|
|
|
| |
This exposes an IP port on the container as local port using DNAT.
|
| |
|
|
|
|
| |
The kernel always returns all addresses, rather than only for the given link, so let's only enumerate once.
|
|
|
|
| |
No idea how this appeared to compile for me. Mea culpa.
|
|
|
|
| |
This makes the API more consistent.
|
| |
|
|
|
|
|
| |
Also check that the source netmask is 0, not only the destination
netmask.
|
|
|
|
|
|
|
|
| |
gateway
This is useful inside of containers or local networks to intrdouce a
stable name of the default gateway host (in case of containers usually
the host, in case of LANs usually local router).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We got the following error when running systemd on a device with many ports:
"rtnl: kernel receive buffer overrun
Event source 'rtnl-receive-message' returned error, disabling: No buffer space
available"
I think the kernel socket receive buffer queue should be increased. The default
value is taken from:
"/proc/sys/net/core/rmem_default", but we can overwrite it using SO_RCVBUF
socket option.
This is already done in networkd for other sockets.
For example, the bus socket (sd-bus/bus-socket.c) has a receive queue of 8MB.
In our case, the default is 208KB.
Increasing the buffer receive queue for manager socket to 512KB should be enough
to get rid of the above error.
[tomegun: bump the limit even higher to 8M]
|
|
|
|
|
| |
This patch adds functionality to set family type
in the rtnl message for example PF_BRIDGE.
|
|
|
|
|
|
|
| |
In the long run this should become a full fledged client to networkd
(but not before networkd learns bus support). For now, just pull
interesting data out of networkd, udev, and rtnl and present it to the
user, in a simple but useful output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All routes added by networkd are currently set RTPROT_BOOT, which according
to the kernel means "Route installed during boot" (rtnetlink.h). But this
is not always the case as networkd changes routing after boot too. Since
the kernel gives more detailed protocols, use them.
With this patch, user-configured static routes now use RTPROT_STATIC (which
they are) and DHCP routes use RTPROT_DHCP. There is no define for IPv4LL
yet, so those are installed as RTPROT_STATIC (though perhaps RTPROT_RA is
better?).
[tomegun: fixup
src/network/networkd-link.c:972:33: error: too few arguments to function 'route_new_dynamic']
|
|
|
|
|
|
|
|
| |
Let's settle on a single type for all address family values, even if
UNIX is very inconsitent on the precise type otherwise. Given that
socket() is the primary entrypoint for the sockets API, and that uses
"int", and "int" is relatively simple and generic, we settle on "int"
for this.
|
| |
|
|
|
|
|
| |
The bitmask is deprecated in the kernel, so move to the new interface. At the moment
this does not make a difference for us, but it avoids having to change the API in the future.
|
| |
|
| |
|
|
|
|
|
|
|
| |
messages
This means the API can stay the same as for single-part messages by simply passing the head message around. Unrefing
the head of the linked list unrefs the whole list.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently when both ipv4ll and dhcp are enabled, ipv4ll
address (if one has been claimed) is removed when dhcp
address is aquired. This is not the best thing to do
since there might be clients unaware of the removal
trying to communicate.
This patch provides a smooth transition between ipv4ll
and dhcp. If ipv4ll address was claimed [1] before dhcp,
address is marked as deprecated. Deprecated address is still
a valid address and packets can be received on it but address
cannot be selected as a source address. If dhcp lease cannot
be extended, then ipv4ll address is marked as valid again.
[1] If there is no collision, claiming IPv4LL takes between 4 to
7 seconds.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use a static table with all the typing information, rather than repeated
switch statements. This should make it a lot simpler to add new types.
We need to keep all the type info to be able to create containers
without exposing their implementation details to the users of the library.
As a freebee we verify the types of appended/read attributes.
The API is extended to nicely deal with unions of container types.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend rta_offset_tb into a stack of offset tables, one for each parent of the
current container, and make sd_rtnl_message_{enter,exit}_container() pop/push
to this stack.
Also make sd_rtnl_message_rewind() parse the top-level container, and use this
when reading a message from the socket.
This changes the API by dropping the now redundant sd_rtnl_message_read()
method.
|
|
|
|
|
| |
Otherwise the sequence number of a broadcast may match the sequence number of a
pending unicast message and cause confusion.
|
|
|
|
|
|
|
| |
This patch introduces reading ethernet address and IPV4/IPv6
as well which is based on table based look up.
[tomegun: rename read_ether() to read_ether_addr() to match the append function.]
|
|
|
|
|
|
|
|
|
| |
This patch introduces new netlink attribute parsing logic
which is table based lookup and sd_rtnl_message_read_*
methods for reading attributes. By doing this user does not
have to loop for the attribute values . Only providing the
attribute type it gets the attribute values which is optimized
and sd_rtnl_message_read_* methods are simplified.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implements IPv4LL with respect to RFC 3927
(http://tools.ietf.org/rfc/rfc3927.txt) and integrates it
with networkd. Majority of the IPv4LL state machine is
taken from avahi (http://avahi.org/) project's autoip.
IPv4LL can be enabled by IPv4LL=yes under [Network]
section of .network file.
IPv4LL works independent of DHCP but if DHCP lease is
aquired, then LL address will be dropped.
[tomegun: removed a trailing newline and a compiler warning]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:
1. The object the new object is derived from is put first, if there is any
2. The object we are creating will be returned in the next arguments
3. This is followed by any additional arguments
Rationale:
For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.
Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.
Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that.
|
|
|
|
| |
This mimics the sd-bus api, as we may need it in the future.
|
| |
|
|
|
|
| |
We can always know the size based on the type, so let's do this inside the library.
|
| |
|
|
|
|
|
|
|
|
| |
sd_rtnl_xxx_new_yyy()
So far we followed the rule to always indicate the "flavour" of
constructors after the "_new_" or "_open_" in the function name, so
let's keep things in sync here for rtnl and do the same.
|
|
|
|
|
|
| |
Added sd_rtnl_message_append_u8 and
few attribute support in sd_rtnl_message_append_u32
IFLA_GROUP, IFLA_TXQLEN, IFLA_NUM_TX_QUEUES, IFLA_NUM_RX_QUEUES
|
|
|
|
|
| |
Also insist on messages being sealed before reading them. In other
words we don't allow interleaving of reading and appending to messages.
|
|
|
|
| |
Split out into sd_rtnl_message_addr_set_{prefixlen,flags,scope}().
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Drop most of the arguments and instead introduce set_dst_prefixlen().
|
|
|
|
| |
Drop most of the arguments and instead introduce link_set_{flags,type}.
|
| |
|
|
|
|
|
| |
sd_rtnl_add_match allows you to add a callback function for when given types of
messages are received.
|
|
|
|
|
| |
For now, we only support one container type IFLA_LINKINFO, and we
still lack support for parsing the containers again.
|
| |
|