Commit graph

44 commits

Author SHA1 Message Date
Yu Watanabe f5947a5e92 tree-wide: drop missing.h 2019-10-31 17:57:03 +09:00
Yu Watanabe 737f140546 network: cleanup header inclusion 2019-10-30 22:23:43 +09:00
1848 6ba0e7c8fe Set key (IFLA_GRE_IKEY,IFLA_GRE_OKEY) on ip6gre interfaces. 2019-10-20 00:25:58 +02:00
Yu Watanabe dfc3365593 network: ip6tnl and vti6 does not support the case both Local= and Remote= are any
This partially revert feb0c8b86f.

This also drop assertions about Tunnel.family.
2019-07-11 15:09:09 +09:00
Yu Watanabe 8c9c703c55 network: add AssignToLoopback= setting to [Tunnel] section
networkd does not manage loopback interface lo. So, previously, we have
no way to assign tunnel devices to lo.
2019-07-11 09:59:06 +09:00
Yu Watanabe feb0c8b86f network: support gre tunnel or friends with Local=any Remote=any
Fixes #13014.
2019-07-11 00:03:57 +02:00
Yu Watanabe daf0f8ca87 network: add NetDevVTable::generate_mac flag 2019-05-28 22:45:35 +09:00
Yu Watanabe 9aa5d8ba84 network: include glibc headers before including kernel headers 2019-05-09 03:21:31 +02:00
Yu Watanabe 01234e1fe7 tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0 2019-04-11 19:00:37 +02:00
Yu Watanabe a27a0ad641 network: merge ipip_init() and sit_init() 2019-04-02 03:07:08 +09:00
Yu Watanabe 4799d932b5 network: add FooOverUDP support for SIT and GRE tunnels 2019-04-02 03:07:08 +09:00
Yu Watanabe a8b9a65c50 network: make GRE and GRETAP support Key=, InputKey=, OutputKey=, and SerializeTunneledPackets=
This also merge netdev_gre_fill_message_create() and netdev_erspan_fill_message_create().
2019-03-30 21:16:03 +09:00
Yu Watanabe 9282f75bf4 network: make erspan netdev can be specified in Network.Tunnel= 2019-03-30 03:52:25 +09:00
Yu Watanabe 1a9bc3d8f6 network: do not continue when appending data to netlink message fails 2019-03-30 03:52:21 +09:00
Yu Watanabe bb9683e096 network: fix netdev_tunnel_verify()
Fixes #12041.
2019-03-22 01:47:38 +09:00
Yu Watanabe 4624289279 network/tunnel: fix log message 2019-02-11 01:29:56 +09:00
Yu Watanabe b7c2bb4c9e network: refuse AF_UNSPEC for Tunnel devices 2019-02-11 01:29:56 +09:00
Yu Watanabe 9e64c1f8b5 network: unify netdev_{ipip,sit}_fill_message_create() 2019-02-11 01:29:56 +09:00
Yu Watanabe 3affe303d3 network: unify netdev_vti{,6}_fill_message_create() 2019-02-11 01:29:56 +09:00
Yu Watanabe bd930cbdeb network: shorten code by using SYNTHETIC_ERRNO() 2019-02-11 01:28:09 +09:00
Yu Watanabe 3f7cc0809d network: coding style fixes 2019-02-11 01:28:09 +09:00
Yu Watanabe d40b01e44b network: in_addr_is_null() may return negative errno
So, do not silently cast the returned value to boolean.
Exception is the case that family is trivially AF_INET or AF_INET6.
2019-02-11 01:28:09 +09:00
Susant Sahani 918049ad53 networkd: Add support to configure ISATAP tunnel
Let's just reuse the code of sit tunnel to create a ISATAP tunnel.
Matter of turning a flag

Please see https://elixir.bootlin.com/linux/v4.19.6/source/net/ipv6/sit.c#L208
2018-12-03 09:15:24 +05:30
Susant Sahani 2266864b04 networkd: Add support for ERSPAN tunnel
Please see: https://patchwork.ozlabs.org/patch/800327/
```
[NetDev]
Name=erspan-test
Kind=erspan

[Tunnel]
Independent=true
ERSPANIndex=123
Local = 172.16.1.200
Remote = 172.16.1.100
Key=101
SerializeTunneledPackets=true
```
2018-11-27 11:04:42 +09:00
Yu Watanabe bf877a54c7
Merge pull request #10669 from danderson/networkd-6rd
networkd: add 6rd support for sit netdevs
2018-11-12 15:55:03 +09:00
Yu Watanabe 30dce346d8 network: add missing verification for ip6gretap and sit
Fixes oss-fuzz#11324.
2018-11-10 15:53:18 +09:00
David Anderson d067cab35c networkd: support 6rd tunnel netdev setup. 2018-11-09 17:56:33 -08:00
Yu Watanabe 80df8f2518 missing: support old linux/fou.h
linux/fou.h was introduced in 3.18.
FOU_ATTR_REMCSUM_NOPARTIAL was added in 4.0.
FOU_CMD_GET was added in 4.1.

Follow-up for 53cb501a13.
Fixes #10474.
2018-10-21 22:34:28 +09:00
Susant Sahani 53cb501a13 networkd and sd-netlink: add support for Generic netlink And FooOverUDP to IPIP tunnel
This work add support to generic netlink to sd-netlink.
See https://lwn.net/Articles/208755/

networkd: add support FooOverUDP support to IPIP tunnel netdev
https://lwn.net/Articles/614348/

Example conf:

/lib/systemd/network/1-fou-tunnel.netdev
```
[NetDev]
Name=fou-tun
Kind=fou

[FooOverUDP]
Port=5555
Protocol=4

```

/lib/systemd/network/ipip-tunnel.netdev
```
[NetDev]
Name=ipip-tun
Kind=ipip

[Tunnel]
Independent=true
Local=10.65.208.212
Remote=10.65.208.211
FooOverUDP=true
FOUDestinationPort=5555
```

$ ip -d link show ipip-tun
```
5: ipip-tun@NONE: <POINTOPOINT,NOARP> mtu 1472 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ipip 10.65.208.212 peer 10.65.208.211 promiscuity 0
    ipip remote 10.65.208.211 local 10.65.208.212 ttl inherit pmtudisc encap fou encap-sport auto encap-dport 5555 noencap-csum noencap-csum6 noencap-remcsum numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
```
2018-08-23 11:30:37 +02:00
Zbigniew Jędrzejewski-Szmek d9b02e1697 tree-wide: drop copyright headers from frequent contributors
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
2018-06-20 11:58:53 +02:00
Lennart Poettering 96b2fb93c5 tree-wide: beautify remaining copyright statements
Let's unify an beautify our remaining copyright statements, with a
unicode ©. This means our copyright statements are now always formatted
the same way. Yay.
2018-06-14 10:20:21 +02:00
Lennart Poettering 818bf54632 tree-wide: drop 'This file is part of systemd' blurb
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.
2018-06-14 10:20:20 +02:00
Susant Sahani 194c03c839 networkd: tunnel ignore wrong conf rather than assert
Closes #9234
2018-06-08 16:09:19 +02:00
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
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.
2018-04-06 18:58:55 +02:00
Susant Sahani 3e52ec4301 netword: tunnel remove unwanted space. 2018-01-22 15:50:07 +01:00
Susant Sahani 3a4f3e423d networkd: Tunnel allows tunnel traffic on ip6tnl devices (#7756)
where the remote endpoint is a local host address.
2017-12-29 23:19:21 +09:00
Zbigniew Jędrzejewski-Szmek 53e1b68390 Add SPDX license identifiers to source files under the LGPL
This follows what the kernel is doing, c.f.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
2017-11-19 19:08:15 +01:00
Robin McCorkell 521cdf01e4 Fix creating independent VTI tunnel (#7303) 2017-11-13 10:14:36 +01:00
Susant Sahani 4d7fa6de3b networkd: Allow tunnels to be created without .network (#6701)
Now we don't support tunnels to be created without a .network file
that is we need a interface index.

This work allows tunnel to be created without a ifindex.

Closes #6695
2017-08-31 18:51:03 +02:00
Susant Sahani 8999954f44 networkd: fix assertion crash for tunnel, log error instead (#5465)
GRE6 and IP6TNL address should be a IPv6.

fix :

```
Assertion 't->family == AF_INET6' failed at src/network/netdev/tunnel.c:170,
function netdev_ip6gre_fill_message_create(). Aborting.
```
2017-02-28 10:32:22 +01:00
Zbigniew Jędrzejewski-Szmek 6f3d4decf2 networkd: check that VTI/VTI6 tunnels have a local address
Otherwise we'd fail with an assertion:
Assertion 't->family == AF_INET' failed at ../src/network/netdev/tunnel.c:244, function netdev_vti_fill_message_create(). Aborting.
2016-12-09 13:55:14 -05:00
Zbigniew Jędrzejewski-Szmek 6e47dbbcb3 networkd: tighten parsing of Tunnel addresses
When assigning addresses, we'd set the family, and later
verify that the address on the other end has the same family.
But when the address was specified as "any", we'd simply unset
the family. Instead, only unset the family if both addresses
are wiped.

Also, don't bother setting family = AF_UNSPEC, since it's the default (0).
2016-12-09 13:55:14 -05:00
Zbigniew Jędrzejewski-Szmek 40a922d055 networkd: use log_netdev_error in a two more places 2016-12-09 13:55:14 -05:00
Tom Gundersen 441e9ae4d9 networkd: netdev - move to separate subdirectory
This could (and should) be made into a separate daemon, at least move
the sourcefiles out for now.
2016-11-13 05:16:49 +01:00
Renamed from src/network/networkd-netdev-tunnel.c (Browse further)