1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

22484 Commits

Author SHA1 Message Date
Ronny Chevalier
5625be76c7 test-ipv4ll: use unsigned instead of an array for a seed
ipv4ll use an unsigned instead of an uint8_t array. Hence, use an
unsigned seed instead of declaring an array and then dereferencing it
later.
2015-09-21 16:52:52 +02:00
Ronny Chevalier
56065db421 sd-ipv4ll: do not assert_return when seed == 0
Now that seed is an unsigned and not an array, we do not need to assert
on it.
2015-09-21 16:52:52 +02:00
Tom Gundersen
a1b7a5bbdd Merge pull request #1288 from teg/ipv4acd-3
sd-ipv4acd: split out as separate library from sd-ipv4ll
2015-09-21 15:13:18 +02:00
Lennart Poettering
26ce779618 Merge pull request #1311 from jsynacek/kill-errors-v2
core: extend KillUnit() to return error when no unit was killed
2015-09-21 15:04:23 +02:00
Lennart Poettering
213634e476 Merge pull request #1314 from evverx/cgtop-machine
cgtop: add -M/--machine
2015-09-21 14:55:48 +02:00
Evgeny Vereshchagin
96a6426f30 cgtop: add -M/--machine 2015-09-21 12:04:45 +00:00
Jan Synacek
ac5e3a505e core: extend KillUnit() to return error when no unit was killed 2015-09-21 10:05:49 +02:00
Lennart Poettering
8c710f3ce6 Merge pull request #1292 from gebi/resolve-specifier-in-runtime-directory
load-fragment: resolve specifiers in RuntimeDirectory
2015-09-20 19:15:04 +02:00
Lennart Poettering
4b8b34855e Merge pull request #1305 from mrkara/master
[l10n] Added Turkish translation
2015-09-20 19:14:37 +02:00
Lennart Poettering
570b3e835e Merge pull request #1309 from nazgul77/master
[l10n] Update German translation
2015-09-20 19:14:09 +02:00
nazgul77
5252cfb433 Update German translation 2015-09-20 14:54:34 +02:00
Benjamin Robin
9de009a9f5 systemd-notify: Always pass a valid pid to sd_pid_notify
If the option --pid was used, take the pid from this option, unless take
the parend pid. Using 0 as pid (ucred of systemd-notify) will result 99% of the
time in a failure with this error: "Cannot find unit for notify message of PID"

Shouldn't we use always the ppid, since the MAINPID is something else ?

Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
2015-09-20 04:02:20 +02:00
Muhammet Kara
7c54a17a10 [l10n] Added Turkish translation 2015-09-19 08:35:32 +03:00
Lennart Poettering
dcc26ae383 Merge pull request #1303 from evverx/show-controller
cgls: show controller without args too
2015-09-19 01:49:25 +02:00
Evgeny Vereshchagin
58033c91e3 cgls: show controller without args too 2015-09-18 18:14:38 +00:00
Tom Gundersen
7b713b81c2 sd-ipv4{acd,ll}: add simple test programs
These programs should be run manually, typically two instances on a
veth pair to check conflict detection.

Both test programs take the ifname as input, the ACD also takes the
IP address to check, whereas LL (optionally) takes the seed, which
determines the sequence of IP addresses to try.
2015-09-18 15:14:43 +02:00
Tom Gundersen
e3dca0089b sd-ipv4acd: introduce new library split out from sd-ipv4ll
This splits the Address Conflict Detection out of the Link Local
library so that we can reuse it for DHCP and static addresses in
the future.

Implements RFC5227.
2015-09-18 15:14:43 +02:00
Tom Gundersen
6af9144f5f sd-ipv4ll: simplify conflict handling
Use stop() and start() to drop some pulicate code.
2015-09-18 15:14:43 +02:00
Tom Gundersen
b45e4eb679 sd-ipv4ll: rework callbacks
Firstly, no longer distinguish between STOP and INIT states.

Secondly, do not trigger STOP events when calls to sd_ipv4ll_*() fail. The
caller is the one who would receive the event and will already know that the
call to sd_ipv4ll_*() has failed, so it is redundant.

STOP events will now only be triggered by calling sd_ipv4ll_stop() explicitly
or by some internal error in the library triggered by receiving a packet or
an expiring timeout (i.e., any error that would otherwise not be reported
back to the consumer of the library).

Lastly, follow CODING_STYLE and always return NULL on unref. Protect from
objects being destroyed in callbacks accordingly.
2015-09-18 15:14:43 +02:00
Tom Gundersen
5707940ed3 sd-ipv4ll: don't allow changing MAC address whilst running
This requires the caller to stop and restart the statemachine if they want to
change the MAC address.
2015-09-18 15:14:42 +02:00
Tom Gundersen
94a355a130 sd-ipv4ll: code cleanups
Simplify timeout handling.
2015-09-18 15:14:42 +02:00
Tom Gundersen
028e0b2056 sd-ipv4ll: remove duplicate packet verification
Most packets are filtered out by the BPF, so only check for the parts that may
actually differ.
2015-09-18 15:14:42 +02:00
Tom Gundersen
25d6213b43 sd-ipv4ll: minor cleanups 2015-09-18 15:14:42 +02:00
Tom Gundersen
b26f7e8ec9 sd-ipv4ll: split out on_conflict() from on_packet() 2015-09-18 15:14:42 +02:00
Tom Gundersen
8e5787b5e0 sd-ipv4ll: split run_state_machine() into on_packet() and on_timeout()
Simplify the code a bit, no functional change.
2015-09-18 15:14:42 +02:00
Tom Gundersen
996d16975b sd-ipv4ll: filter out unwanted ARP packets in the kernel
We currently process every ARP packet, but we should only care about the ones
relating to our IP address.

Also rename ipv4ll helpers to apr-utils.[ch], and rework the helpers a bit.
2015-09-18 15:14:42 +02:00
Daniel Mack
2b2eac39e8 Merge pull request #1297 from NoXPhasma/g9fix
G9/G9x change to default resolutions
2015-09-18 14:53:35 +02:00
NoXPhasma
7703518c20 G9/G9x change to default resolutions 2015-09-18 14:28:16 +02:00
Lennart Poettering
16a012b1d0 Merge pull request #1241 from ssahani/net
networkd: add support for accept ra
2015-09-18 13:04:50 +02:00
Daniel Mack
080986a0b6 Merge pull request #1293 from NoXPhasma/G9
Add G9 and G9x [Call of Duty MW3 Edition] to hwdb
2015-09-18 12:17:52 +02:00
NoXPhasma
29264ff382 Add G9 and G9x [Call of Duty MW3 Edition] 2015-09-18 11:55:38 +02:00
Michael Gebetsroither
9b5864d9d9 load-fragment: resolve specifiers in RuntimeDirectory 2015-09-18 11:39:03 +02:00
Martin Pitt
10f4371fd7 Revert "keymap: Add Corsair K70"
This breaks the same vendor/product ID with the German keyboard layout. As this
is a hack around some weird keyboard driver bug, let's revert until this is
understood better.

See https://github.com/systemd/systemd/issues/1243

This reverts commit a2aa71a954.
2015-09-17 16:10:19 +02:00
Daniel Mack
83563d169c Merge pull request #1285 from michich/fix-dbus-fd-recv
sd-bus: correct size calculation in DBus fd receive
2015-09-17 00:05:58 +02:00
Michal Schmidt
a0f5ab70f3 sd-bus: correct size calculation in DBus fd receive
The size of the allocated array for received file descriptors was
incorrectly calculated. This did not matter when a single file
descriptor was received, but for more descriptors the allocation was
insufficient.
2015-09-16 23:53:32 +02:00
Lennart Poettering
5ee50f525f Merge pull request #1269 from zonque/netcls
cgroup: add support for net_cls controllers
2015-09-16 20:59:31 +02:00
Daniel Mack
7ed1f63d50 Merge pull request #1279 from teg/resolved-cname-cache
resolevd: cache - improve CNAME handling
2015-09-16 17:59:11 +02:00
Tom Gundersen
5eefe544ef resolved: cache - cache what we can of negative redirect chains
When a NXDATA or a NODATA response is received for an alias it may
include CNAME records from the redirect chain. We should cache the
response for each of these names to avoid needless roundtrips in
the future.

It is not sufficient to do the negative caching only for the
canonical name, as the included redirection chain is not guaranteed
to be complete. In fact, only the final CNAME record from the chain
is guaranteed to be included.

We take care not to cache entries that redirects outside the current
zone, as the SOA will then not be valid.
2015-09-16 17:03:18 +02:00
Tom Gundersen
5643c00afe resolved: cache - handle CNAME redirection
CNAME records are special in the way they are treated by DNS servers,
and our cache should mimic that behavior: In case a domain name has an
alias, its CNAME record is returned in place of any other.

Our cache was not doing this despite caching the CNAME records, this
entailed needless lookups to re-resolve the CNAME.
2015-09-16 17:03:17 +02:00
Tom Gundersen
8e427d9be9 resolved: cache - only allow putting a single question key at a time
Only one key is allowed per transaction now, so let's simplify things and only allow putting
one question key into the cache at a time.
2015-09-16 17:03:17 +02:00
Tom Gundersen
36d9205d66 resolved: rr - introduce dns_resource_key_new_redirect()
Takes a key and CNAME RR and returns the canonical RR of the right
type. Make use of this in dns_question_redirect().
2015-09-16 17:03:17 +02:00
Tom Gundersen
7c1ff6ac3d resolved: rr - introduce dns_resource_key_new_cname()
Creates a new CNAME RR key with the same class and name as an existing key.
2015-09-16 17:03:17 +02:00
Tom Gundersen
04f9320120 resolved: cache - clarify logging 2015-09-16 17:03:17 +02:00
Lennart Poettering
b91a501fcd Merge pull request #1278 from michich/nicer-asserts
nicer assert messages
2015-09-16 16:27:00 +02:00
Michal Schmidt
a8b626100b basic: nicer xsprintf and xstrftime assert messages
It's nicer if the assertion failure message from a bad use of xsprintf
actually mentions xsprintf instead of the expression the macro is
implemented as.

The assert_message_se macro was added in the previous commit as an
internal helper, but it can also be used for customizing assertion
failure messages like in this case.

Example:
  char buf[10];
  xsprintf(buf, "This is a %s message.\n", "long");

Before:
  Assertion '(size_t) snprintf(buf, ELEMENTSOF(buf), "This is a %s
  message.\n", "long") < ELEMENTSOF(buf)' failed at foo.c:6, function
  main(). Aborting.

After:
  Assertion 'xsprintf: buf[] must be big enough' failed at foo.c:6,
  function main(). Aborting.
2015-09-16 15:48:00 +02:00
Michal Schmidt
34c38d2aaa basic: nicer assert messages
Make sure the assert expression is not macro-expanded before
stringification. This makes several assertion failure messages more
readable.

As an example:
  assert(streq("foo", "bar"));

I'd rather see this:

Assertion 'streq("foo", "bar")' failed at foo.c:5, function main(). Aborting.

...than this, though awesome, incomprehensible truncated mess:

Assertion '(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ((
"foo")) && __builtin_constant_p (("bar")) && (__s1_len = strlen (("foo")), __s2_
len = strlen (("bar")), (!((size_t)(const void *)((("foo")) + 1) - (size_t)(cons
t void *)(("foo")) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((("bar")
) + 1) - (size_t)(const void *)(("bar")) == 1) || __s2_len >= 4)) ? __builtin_st
rcmp (("foo"), ("bar")) : (__builtin_constant_p (("foo")) && ((size_t)(const voi
d *)((("foo")) + 1) - (size_t)(const void *)(("foo")) == 1) && (__s1_len = strle
n (("foo")), __s1_len < 4) ? (__builtin_constant_p (("bar")) && ((size_t)(const
void *)((("bar")) + 1) - (size_t)(const void *)(("bar")) == 1) ? __builtin_strcm
p (("foo"), ("bar")) : (__extension__ ({ const unsigned char *__s2 = (const unsi
gned char *) (const char *) (("bar")); int __result = (((const unsigned char *)
(const char *) (("foo")))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __
result = (((const unsigned char *) (const char *) (("foo")))[1] - __s2[1]); if (
__s1_len > 1 && __result == 0) { __result = (((const unsigned char *) (const cha
r *) (("foo")))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((
const unsigned char *) (const char *) (("foo")))[3] - __s2[3]); } } __result; })
)) : (__builtin_constant_p (("bar")) && ((size_t)(const void *)((("bar")) + 1) -
 (size_t)(const void *)(("bar")) == 1) && (__s2_len = strlen (("bar")), __s2_len
 < 4) ? (__builtin_constant_p (("foo")) && ((size_t)(const void *)((("foo")) + 1
) - (size_t)(const void *)(("foo")) == 1) ? __builtin_strcmp (("foo"), ("bar"))
: (- (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (cons
t char *) (("foo")); int __result = (((const unsigned char *) (const char *) (("
bar")))[0] - __s2[0]); if (__s2_len > 0 && __result == 0) { __result = (((const
unsigned char *) (const char *) (("bar")))[1] - __s2[1]); if (__s2_len > 1 && __
result == 0) { __result = (((const unsigned char *) (const char *) (("bar")))[2]
 - __s2[2]); if (__s2_len > 2 && __result == 0)
2015-09-16 15:48:00 +02:00
Michal Schmidt
7f39a21045 basic: make sure argument of ELEMENTSOF is an array
Using ELEMENTSOF on a pointer will result in a compilation error.
2015-09-16 15:32:25 +02:00
Daniel Mack
32ee7d3309 cgroup: add support for net_cls controllers
Add a new config directive called NetClass= to CGroup enabled units.
Allowed values are positive numbers for fix assignments and "auto" for
picking a free value automatically, for which we need to keep track of
dynamically assigned net class IDs of units. Introduce a hash table for
this, and also record the last ID that was given out, so the allocator
can start its search for the next 'hole' from there. This could
eventually be optimized with something like an irb.

The class IDs up to 65536 are considered reserved and won't be
assigned automatically by systemd. This barrier can be made a config
directive in the future.

Values set in unit files are stored in the CGroupContext of the
unit and considered read-only. The actually assigned number (which
may have been chosen dynamically) is stored in the unit itself and
is guaranteed to remain stable as long as the unit is active.

In the CGroup controller, set the configured CGroup net class to
net_cls.classid. Multiple unit may share the same net class ID,
and those which do are linked together.
2015-09-16 00:21:55 +02:00
Daniel Mack
ac2896bab6 Merge pull request #1270 from frandieguez/master
Add Galician translations
2015-09-15 11:16:06 +02:00
Fran Dieguez
4f95221612 Add Galician language to LINGUAS file 2015-09-15 00:20:51 +02:00