summaryrefslogtreecommitdiffstats
path: root/src/udev/net (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4879 from poettering/systemdZbigniew Jędrzejewski-Szmek2017-01-151-7/+2
|\
| * util-lib: various improvements to kernel command line parsingLennart Poettering2016-12-211-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves kernel command line parsing in a number of ways: a) An kernel option "foo_bar=xyz" is now considered equivalent to "foo-bar-xyz", i.e. when comparing kernel command line option names "-" and "_" are now considered equivalent (this only applies to the option names though, not the option values!). Most of our kernel options used "-" as word separator in kernel command line options so far, but some used "_". With this change, which was a source of confusion for users (well, at least of one user: myself, I just couldn't remember that it's systemd.debug-shell, not systemd.debug_shell). Considering both as equivalent is inspired how modern kernel module loading normalizes all kernel module names to use underscores now too. b) All options previously using a dash for separating words in kernel command line options now use an underscore instead, in all documentation and in code. Since a) has been implemented this should not create any compatibility problems, but normalizes our documentation and our code. c) All kernel command line options which take booleans (or are boolean-like) have been reworked so that "foobar" (without argument) is now equivalent to "foobar=1" (but not "foobar=0"), thus normalizing the handling of our boolean arguments. Specifically this means systemd.debug-shell and systemd_debug_shell=1 are now entirely equivalent. d) All kernel command line options which take an argument, and where no argument is specified will now result in a log message. e.g. passing just "systemd.unit" will no result in a complain that it needs an argument. This is implemented in the proc_cmdline_missing_value() function. e) There's now a call proc_cmdline_get_bool() similar to proc_cmdline_get_key() that parses booleans (following the logic explained in c). f) The proc_cmdline_parse() call's boolean argument has been replaced by a new flags argument that takes a common set of bits with proc_cmdline_get_key(). g) All kernel command line APIs now begin with the same "proc_cmdline_" prefix. h) There are now tests for much of this. Yay!
* | build-sys: add check for gperf lookup function signature (#5055)Mike Gilbert2017-01-101-1/+1
|/ | | | | | gperf-3.1 generates lookup functions that take a size_t length parameter instead of unsigned int. Test for this at configure time. Fixes: https://github.com/systemd/systemd/issues/5039
* link: fix offload features initialization (#4639)Maks Naumov2016-11-141-1/+1
|
* Link: port to new ethtool ETHTOOL_xLINKSETTINGSSusant Sahani2016-11-105-9/+248
| | | | | | | | | | | | | | Link: port to new ethtool ETHTOOL_xLINKSETTINGS This patch defines a new ETHTOOL_GLINKSETTINGS/SLINKSETTINGS API, handled by the new get_link_ksettings/set_link_ksettings . This is a WIP version based on this [kernel patch](https://patchwork.kernel.org/patch/8411401/). commit 0527f1c http://github.com/torvalds/linux/commit/3f1ac7a700d039c61d8d8b99f28d605d489a60cfommit 35afb33
* sd-device/networkd: unify code to get a socket for issuing netdev ioctls onLennart Poettering2016-10-061-3/+3
| | | | | | | | | | | As suggested here: https://github.com/systemd/systemd/pull/4296#issuecomment-251911349 Let's try AF_INET first as socket, but let's fall back to AF_NETLINK, so that we can use a protocol-independent socket here if possible. This has the benefit that our code will still work even if AF_INET/AF_INET6 is made unavailable (for exmple via seccomp), at least on current kernels.
* udev: use get_proc_cmdline_key instead of FOREACH_WORD_QUOTEDZbigniew Jędrzejewski-Szmek2016-09-141-12/+4
|
* fix #4080Susant Sahani2016-09-021-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ethtool_sset_info adding some extra space to it. also fix valgrind warning ``` Unloaded link configuration context. ==31690== ==31690== HEAP SUMMARY: ==31690== in use at exit: 8,192 bytes in 2 blocks ==31690== total heap usage: 431 allocs, 429 frees, 321,164 bytes allocated ==31690== ==31690== 4,096 bytes in 1 blocks are still reachable in loss record 1 of 2 ==31690== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299) ==31690== by 0x166B32: mempool_alloc_tile (mempool.c:62) ==31690== by 0x166BBC: mempool_alloc0_tile (mempool.c:81) ==31690== by 0x15B8FC: hashmap_base_new (hashmap.c:732) ==31690== by 0x15B9F7: internal_hashmap_new (hashmap.c:766) ==31690== by 0x151291: conf_files_list_strv_internal (conf-files.c:103) ==31690== by 0x1514BA: conf_files_list_strv (conf-files.c:135) ==31690== by 0x13A1CF: link_config_load (link-config.c:227) ==31690== by 0x135B68: builtin_net_setup_link_init (udev-builtin-net_setup_link.c:77) ==31690== by 0x1306B3: udev_builtin_init (udev-builtin.c:57) ==31690== by 0x11E984: adm_builtin (udevadm-test-builtin.c:72) ==31690== by 0x117B4D: run_command (udevadm.c:75) ``` Fixes #4080
* link : add support to configure LRO and GRO Offload featuresSusant Sahani2016-08-313-0/+6
| | | | | | | The patch supports to configure GenericReceiveOffload LargeReceiveOffload
* link : add support to configure Offload features (#4017)Susant Sahani2016-08-305-19/+149
| | | | | | | | | This patch supports these features to be on or off Generic Segmentation Offload TCP Segmentation Offload UDP Segmentation Offload fixes #432
* tree-wide: place #pragma once at the same place everywhereLennart Poettering2016-02-202-4/+4
| | | | | | Usually, we place the #pragma once before the copyright blurb in header files, but in a few cases we didn't. Move those around, so that we do the same thing everywhere.
* Remove/add (un)needed includesNathan McSween2016-02-191-1/+0
|
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-104-8/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* siphash24: change result argument to uint64_tMartin Pitt2015-11-161-3/+3
| | | | | | | | | | | | Change the "out" parameter from uint8_t[8] to uint64_t. On architectures which enforce pointer alignment this fixes crashes when we previously cast an unaligned array to uint64_t*, and on others this should at least improve performance as the compiler now aligns these properly. This also simplifies the code in most cases by getting rid of typecasts. The only place which we can't change is struct duid's en.id, as that is _packed_ and public API, so we can't enforce alignment of the "id" field and have to use memcpy instead.
* util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: move /proc/cmdline parsing code to proc-cmdline.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: move string table stuff into its own string-table.[ch]Lennart Poettering2015-10-272-4/+5
|
* util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering2015-10-251-0/+1
| | | | | There are more than enough to deserve their own .c file, hence move them over.
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-242-11/+12
| | | | | | | | | | | | | | 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.
* document ability to disable MACAddressPolicyJacob Keller2015-10-062-1/+4
| | | | | | | | | | While it is currently possible to either not set MACAddressPolicy or set it to a value different from "persistent" or "random", it is not obvious that a user can do so. Add a policy, "none", which simply retains kernel MAC addresses (same as not filling in the policy at all) and document it so that users are aware of this setting. Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
* tree-wide: drop {} from one-line if blocksLennart Poettering2015-09-091-2/+1
| | | | Patch via coccinelle.
* sd-netlink: rename from sd-rtnlTom Gundersen2015-06-131-4/+4
|
* udev: add some assertsTom Gundersen2015-06-021-0/+4
| | | | Mostly for documentation purposes.
* udev: link-config - fix corruptionTom Gundersen2015-05-212-7/+8
| | | | | | | | The parser used for MTU and Speed expects them to be size_t, not unsigned int. This caused a corruption in the rest of the structure. Reported by David O Neill <david.m.oneill@intel.com>.
* udevd: net - fix leak in .link configTom Gundersen2015-05-161-3/+3
| | | | Path, Driver and Type are now strv rather than strings, so free them properly.
* udev: fix coding styleSusant Sahani2015-05-061-2/+1
|
* shared: add random-util.[ch]Ronny Chevalier2015-04-111-0/+1
|
* fix gcc warnings about uninitialized variablesHarald Hoyer2015-03-271-1/+1
| | | | | | | | | | | | | like: src/shared/install.c: In function ‘unit_file_lookup_state’: src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] return r < 0 ? r : state; ^ src/shared/install.c:1796:13: note: ‘r’ was declared here int r; ^
* Use space after a silencing (void)Zbigniew Jędrzejewski-Szmek2015-03-141-1/+1
| | | | | We were using a space more often than not, and this way is codified in CODING_STYLE.
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-232-5/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* net: support globbing and disjunction in Match logicTom Gundersen2015-02-102-8/+8
| | | | Match{Name,OrginalName,Type,Driver,Path} can now take a space-separated glob of matches.
* udev: net_setup - clarify reason for failure of persistent mac address policyTom Gundersen2015-02-061-4/+6
|
* udev: link_config - modernize a bit and fix leakesTom Gundersen2015-01-121-35/+51
| | | | Not all of the link_config struct was getting freed.
* udev: link-config - simplify net-matchTom Gundersen2014-12-081-13/+8
|
* net_setup/networkd: warn if matching is done on possibly unstable ifnameTom Gundersen2014-12-051-12/+33
|
* udev: net_setup - allow matching on OriginalName=Tom Gundersen2014-12-043-3/+15
| | | | | | | | | | | | | | | | | | This has been requested repeatedly, so let's give it a go. We explicitly do not allow matching on names that have already been changed (from a previous udev run, or otherwise), and matching on unpredictable names (ethX) is discouraged (but not currently disallowed). We also currently allow: [Match] Name=veth0 [Link] Name=my-name0 SomeOtherSetting=true Which means that the link file will be applied the first time it is invoked, but not on subsequent invocations, which may be surprising.
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-282-20/+10
| | | | | | | | | | | | | Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
* udev,update-done: more log_xyz_errno() conversionsLennart Poettering2014-11-281-7/+6
|
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-282-5/+5
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-282-5/+5
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* util: simplify proc_cmdline() to reuse get_process_cmdline()Lennart Poettering2014-11-071-4/+3
| | | | Also, make all parsing of the kernel cmdline non-fatal.
* s/commandline/command line/gHarald Hoyer2014-11-061-1/+1
|
* shared: rename condition-util.[ch] to condition.[ch]Lennart Poettering2014-11-061-3/+2
| | | | | Now that we only have one file with condition implementations around, we can drop the -util suffix and simplify things a bit.
* udev: link-config: remove unneded linux/netdevice.h includeEmil Renner Berthing2014-09-181-1/+0
|
* udev: net_setup_link - open ethtool and rtnl connections lazilyTom Gundersen2014-09-093-47/+39
|
* udev: link-config - only set *name on successTom Gundersen2014-09-081-2/+2
|
* udev: link-config - fix crash due to missing hwaddrTom Gundersen2014-08-141-1/+2
| | | | Reported by: master.nosferatu@gmail.com
* networkd: link - split out dhcp4 handlingTom Gundersen2014-08-121-8/+15
|