summaryrefslogtreecommitdiffstats
path: root/src/udev/net (follow)
Commit message (Collapse)AuthorAgeFilesLines
* udev/net: add support for the equivalent of "ethtool advertise" to .link filesSusant Sahani2018-09-265-7/+121
| | | | | This work adds support for the equivalent of "ethtool advertise" to .link files? http://lists.freedesktop.org/archives/systemd-devel/2015-April/030112.html
* udev/net: replace udev_device by sd_deviceYu Watanabe2018-09-102-48/+50
|
* link: allocate correct number of bytes in ethtool_set_features()Thomas Haller2018-08-271-1/+1
| | | | | | | | | | sfeatures is a "struct ethtool_sfeatures". Use sizeof() on the correct data type. Since "struct ethtool_gstrings" is larger than "struct ethtool_sfeatures", this had no serious consequences. Fixes: 50725d10e3417fd357abe1df2f177b8458027ac7
* network: replace udev_device by sd_deviceYu Watanabe2018-08-221-1/+2
|
* link: fix type for link-config's "features" array of tristatesThomas Haller2018-08-074-4/+6
| | | | | | | | | | | | The "features" fields is parsed as a tristate value. The values are thus not of type NetDevFeature enum but int. The NetDevFeature enum is instead the index for the features array. Adjust the type. In practice, this had no impact because NetDevFeature enum commonly has size of int. Also, don't use memset() 0xFF to initilize the int with -1. While it works correctly in practice, it feels ugly.
* tree-wide: drop double newlineYu Watanabe2018-06-292-2/+0
|
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-06-204-12/+0
| | | | | | | | Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
* tree-wide: use proper unicode © instead of (C) where we canLennart Poettering2018-06-144-4/+4
| | | | | | Let's use a proper unicode copyright symbol where we can, it's prettier. This important patch is very important.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-144-8/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* network,udev: sort included headersYu Watanabe2018-05-091-2/+2
|
* network,udev: make MACAddress= in [Match] section take multiple MAC addressesYu Watanabe2018-05-093-3/+4
|
* link: Add support to configure channels of the specified network device (#8882)Susant Sahani2018-05-085-0/+127
| | | closes #8856
* ethtool: get_glinksettings Fix copy (#8889)Susant Sahani2018-05-031-1/+1
| | | It should be other way around.
* link: follow our rule of suffix settings with = in log messagesLennart Poettering2018-04-261-1/+1
|
* networkd,udev: clean up MTU handlingLennart Poettering2018-04-263-3/+3
| | | | | | | | | | | | | | | | This cleans up handling of MTU values across the codebase. Previously MTU values where stored sometimes in uint32_t, sometimes in uint16_t, sometimes unsigned and sometimes in size_t. This now unifies this to uint32_t across the codebase, as that's what netlink spits out, and what the majority was already using. Also, all MTU parameters are now parsed with config_parse_mtu() and config_parse_ipv6_mtu() is dropped as it is now unneeded. (Note there is one exception for the MTU typing: in the DCHPv4 code we continue to process the MTU as uint16_t value, as it is encoded like that in the protocol, and it's probably better stay close to the protocol there.)
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-064-52/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* tree-wide: use TAKE_PTR() and TAKE_FD() macrosYu Watanabe2018-04-051-2/+1
|
* macro: introduce TAKE_PTR() macroLennart Poettering2018-03-221-2/+1
| | | | | | | | | | | | | | | | This macro will read a pointer of any type, return it, and set the pointer to NULL. This is useful as an explicit concept of passing ownership of a memory area between pointers. This takes inspiration from Rust: https://doc.rust-lang.org/std/option/enum.Option.html#method.take and was suggested by Alan Jenkins (@sourcejedi). It drops ~160 lines of code from our codebase, which makes me like it. Also, I think it clarifies passing of ownership, and thus helps readability a bit (at least for the initiated who know the new macro)
* systemd-link: Remove UDP Fragmentation Offload support. (#8183)Rosen Penev2018-03-183-3/+1
| | | | | | | | Support was killed in kernel 4.15 as well as ethtool 4.13. Justification was lack of use by drivers and too much of a maintenance burden. https://www.spinics.net/lists/netdev/msg443815.html Also moved config_parse_warn_compat to conf-parser.[ch] to fix compile errors.
* cocci: there's not ENOTSUP, there's only EOPNOTSUPPLennart Poettering2018-01-111-2/+2
| | | | | | On Linux the former is a compat alias to the latter, and that's really weird, as inside the kernel the two are distinct. Which means we really should stay away from it.
* ethtool-util: don't pass fds as pointers if we don't have toLennart Poettering2018-01-111-17/+18
| | | | Passing them as pointers is just weird, hence don't do it
* ethtool-util: fix weird whitespaceLennart Poettering2018-01-111-3/+1
|
* ethtool-util: order includes properlyLennart Poettering2018-01-111-2/+2
|
* ethtool-util: no need for memcpy() where normal assignment works tooLennart Poettering2018-01-111-2/+2
|
* systemd-udevd: fix speed/duplex processing with valid .link files (#7808)Bruce A. Johnson2018-01-051-3/+3
| | | | | | | Including BitsPerSecond or Duplex values in .link files did not work when set_slinksettings was called because the routine was not copying the base parameters to the structure given to ioctl. As a result, EINVAL was always reported, and no change occurred on the Ethernet device.
* core,udev,networkd: add ConditionKernelVersion=Lennart Poettering2017-12-263-4/+8
| | | | | | | | | | This adds a simple condition/assert/match to the service manager, to udev's .link handling and to networkd, for matching the kernel version string. In this version we only do fnmatch() based globbing, but we might want to extend that to version comparisons later on, if we like, by slightly extending the syntax with ">=", "<=", ">", "<" and "==" expressions.
* udev-link-config: add missing OOM checkLennart Poettering2017-12-141-0/+2
|
* link-config: make initialization to -1 less weirdLennart Poettering2017-12-141-1/+1
| | | | | | | memset() is weird anyway, since it expects an "int" as second parameter, which it then uses as a byte, i.e. as uint8_t or something like that. But by passing -1 to it, things get particularly weird, as that relies on sign expansion to do the right thing.
* tree-wide: adjust fall through comments so that gcc is happyShawn Landden2017-11-202-1/+4
| | | | | | | | Distcc removes comments, making the comment silencing not work. I know there was a decision against a macro in commit ec251fe7d5bc24b5d38b0853bc5969f3a0ba06e2
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-194-0/+4
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* conf-parser: turn three bool function params into a flags fieldsLennart Poettering2017-11-131-1/+1
| | | | | This makes things more readable and fixes some issues with incorrect flag propagation between the various flavours of config_parse().
* build-sys: use #if Y instead of #ifdef Y everywhereZbigniew Jędrzejewski-Szmek2017-10-041-1/+1
| | | | | | | | | | | | | | | The advantage is that is the name is mispellt, cpp will warn us. $ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/" $ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;' $ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g' $ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g' + manual changes to meson.build squash! build-sys: use #if Y instead of #ifdef Y everywhere v2: - fix incorrect setting of HAVE_LIBIDN2
* systemd-link: Add support to configure tx-tcp6-segmentation (#6859)Susant Sahani2017-09-193-5/+8
| | | | | | | | | closes #6854 tcp-segmentation-offload: off tx-tcp-segmentation: off tx-tcp-ecn-segmentation: off [fixed] tx-tcp-mangleid-segmentation: off tx-tcp6-segmentation: off <==========================
* exec-util,conf-files: skip non-executable files in execute_directories()Lennart Poettering2017-09-131-1/+1
| | | | Fixes: #6787
* systemd-link: ethtool add support for more Wake up Lan setting (#6331)Susant Sahani2017-08-312-23/+63
| | | This works supports to configure nicast, multicast, broadcast, arp and SecureOn.
* build-sys: drop gitignore patterns for in-tree buildsZbigniew Jędrzejewski-Szmek2017-07-181-1/+0
| | | | ... and other autotools-generated files.
* build-sys: drop automake supportZbigniew Jędrzejewski-Szmek2017-07-181-1/+0
| | | | | v2: - also mention m4
* ethtool: fix half-duplex / full-duplex confusion (#6209)Susant Sahani2017-06-301-2/+2
| | | | The values that we used for half-duplex and full-duplex in ethtool_set_glinksettings were reversed wrt. what the kernel uses.
* ethtool: warn when ethtool_set_glinksettings not supportedSusant Sahani2017-06-261-5/+6
| | | | This is useful when port is not set and should be notified to user.
* ethtool: Fix speed in 593022fa377d40d9a645919759b04c53cf4eace8Susant Sahani2017-06-261-1/+1
| | | | We should use the DIV_ROUND_UP
* systemd-link: add support to configure the device port (#6153)Susant Sahani2017-06-265-11/+47
| | | | | | | | | This work allows to configure device port: tp — An Ethernet interface using Twisted-Pair cable as the medium. aui — Attachment Unit Interface (AUI). Normally used with hubs. bnc — An Ethernet interface using BNC connectors and co-axial cable. mii — An Ethernet interface using a Media Independent Interface (MII). fibre — An Ethernet interface using Optical Fibre as the medium.
* 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