diff options
author | Thierry Martin <tmartin@haproxy.com> | 2022-09-05 15:02:06 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-04-12 14:28:43 +0200 |
commit | 2f091b1b49543aade4aad9ec3b35b3665abac3e7 (patch) | |
tree | 9fc428bbdeec30c3870c4f7ea771486aa1668009 /src/nspawn/nspawn-settings.c | |
parent | 3af48a86d99b3117a44bc22258ab4d34d0ba7655 (diff) | |
download | systemd-2f091b1b49543aade4aad9ec3b35b3665abac3e7.tar.gz |
nspawn: container network interface naming
systemd-nspawn now optionally supports colon-separated pair of
host interface name and container interface name for --network-macvlan, --network-ipvlan and --network-interface options.
Also supported in .nspawn configuration files (i.e Interface=, MACVLAN=, IPVLAN= parameters).
man page changed for ntwk interface naming
Diffstat (limited to 'src/nspawn/nspawn-settings.c')
-rw-r--r-- | src/nspawn/nspawn-settings.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/nspawn/nspawn-settings.c b/src/nspawn/nspawn-settings.c index 05bde1c756..7500eabd18 100644 --- a/src/nspawn/nspawn-settings.c +++ b/src/nspawn/nspawn-settings.c @@ -469,6 +469,69 @@ int config_parse_veth_extra( return 0; } +int config_parse_network_iface_pair( + const char *unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + char*** l = data; + + assert(filename); + assert(lvalue); + assert(rvalue); + + return interface_pair_parse(l, rvalue); +} + +int config_parse_macvlan_iface_pair( + const char *unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + char*** l = data; + + assert(filename); + assert(lvalue); + assert(rvalue); + + return macvlan_pair_parse(l, rvalue); +} + +int config_parse_ipvlan_iface_pair( + const char *unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + char*** l = data; + + assert(filename); + assert(lvalue); + assert(rvalue); + + return ipvlan_pair_parse(l, rvalue); +} + int config_parse_network_zone( const char *unit, const char *filename, |