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

22461 Commits

Author SHA1 Message Date
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
Fran Dieguez
fd59243cf1 Added Galician translations 2015-09-15 00:20:21 +02:00
Lennart Poettering
d801577473 Merge pull request #1250 from g2p/master
Hook more properties for transient units
2015-09-14 23:19:03 +02:00
Daniel Mack
e72b93fc7b Merge pull request #1267 from systemd-mailing-devs/1442233013-14985-1-git-send-email-hdegoede@redhat.com
hwdb: Add Thinkpad X1 carbon 3rd gen to 70-pointingstick.hwdb
2015-09-14 17:27:11 +02:00
Hans de Goede
c01705b9ee hwdb: Add Thinkpad X1 carbon 3rd gen to 70-pointingstick.hwdb
Like many other recent thinkpads the factory default pointingstick
sensitivity on these devices is quite low, making the pointingstick
very slow in moving the cursor.

This extends the existing hwdb rules for tweaking the sensitivity to
also apply to the X1 carbon 3rd gen model.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1200717
2015-09-14 15:05:05 +02:00
Daniel Mack
0d9f6d4f61 Merge pull request #1259 from martinpitt/master
keymap: Add Corsair K70
2015-09-14 10:02:36 +02:00
Martin Pitt
a2aa71a954 keymap: Add Corsair K70 2015-09-14 09:26:19 +02:00
Karel Zak
d379d44255 mount: use libmount to monitor mountinfo & utab
The current implementation directly monitor /proc/self/mountinfo and
/run/mount/utab files. It's really not optimal because utab file is
private libmount stuff without any official guaranteed semantic.

The libmount since v2.26 provides API to monitor mount kernel &
userspace changes and since v2.27 the monitor is usable for
non-root users too.

This patch replaces the current implementation with libmount based
solution.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-14 09:12:31 +02:00
Daniel Mack
5669ef3644 Merge pull request #1251 from poettering/cgroups-cleanup
cgroups cleanup + other fixes
2015-09-13 20:44:30 +02:00
Daniel Mack
2d0fd6e1c5 Merge pull request #1253 from victorenator/master
po: update Belarusian translation
2015-09-13 19:44:50 +02:00
Viktar Vauchkevich
47130da825 po: update Belarusian translation 2015-09-12 16:47:18 +03:00
Susant Sahani
941d0aa8f4 man: add support for accept ra man 2015-09-12 08:18:36 +05:30
Susant Sahani
4f2e437ad7 networkd:add support to configure ipv6 acceprt ra
This patch support to configure the ipv6 acceprt ra option.

for more information see
http://www.tldp.org/HOWTO/Linux+IPv6-HOWTO/proc-sys-net-ipv6..html
2015-09-12 08:18:06 +05:30
Lennart Poettering
e7ab4d1ac9 cgroup: unify how we invalidate cgroup controller settings
Let's make sure that we follow the same codepaths when adjusting a
cgroup property via the dbus SetProperty() call, and when we execute the
StartupCPUShares= effect.
2015-09-11 18:31:50 +02:00
Lennart Poettering
1afaa7e8d2 transaction: clarify via void-casting that we ignore the pipe2() return value for a reason 2015-09-11 18:31:50 +02:00
Lennart Poettering
cd72bd8a46 core: invalidate idle pipe event source in manager_close_idle_pipe()
In all occasions when this function is called we do so anyway, so let's
move this inside, to make things easier.
2015-09-11 18:31:50 +02:00
Lennart Poettering
c7cc737fce execute: fix return type from write() 2015-09-11 18:31:49 +02:00
Lennart Poettering
54eb2300ae execute: invalidate idle pipe after use
Not strictly necessary, but makes clear the fds are invalidated. Make
sure we do the same here as in most other cases.
2015-09-11 18:31:49 +02:00
Lennart Poettering
5269eb6b32 core: allocate sets of startup and failed units on-demand
There's a good chance we never needs these sets, hence allocate them
only when needed.
2015-09-11 18:31:49 +02:00
Lennart Poettering
aa36007ca1 timesyncd: fix how we print a PID 2015-09-11 18:31:49 +02:00
Lennart Poettering
d53d94743c core: refactor cpu shares/blockio weight cgroup logic
Let's stop using the "unsigned long" type for weights/shares, and let's
just use uint64_t for this, as that's what we expose on the bus.

Unify parsers, and always validate the range for these fields.

Correct the default blockio weight to 500, since that's what the kernel
actually uses.

When parsing the weight/shares settings from unit files accept the empty
string as a way to reset the weight/shares value. When getting it via
the bus, uniformly map (uint64_t) -1 to unset.

Open up StartupCPUShares= and StartupBlockIOWeight= to transient units.
2015-09-11 18:31:49 +02:00
Lennart Poettering
afc966e288 util: remove ring.[ch] + pty.[ch] and tests
This was used by consoled, which was removed, let's remove this too now.
2015-09-11 18:28:29 +02:00
Lennart Poettering
5738311653 TODO 2015-09-11 18:28:03 +02:00
Gabriel de Perthuis
b9c50073fc Hook more properties for transient units
systemd-run can now launch units with PrivateTmp, PrivateDevices,
PrivateNetwork, NoNewPrivileges set.
2015-09-11 18:25:41 +02:00