diff options
author | Daniel Mack <github@zonque.org> | 2015-07-25 10:48:43 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-07-25 10:48:43 +0200 |
commit | 3460810e8c61986a4605ad80c9e4805eb95cb5a1 (patch) | |
tree | d819524ea1ee5d6bb92e0156eca418319476e0dd | |
parent | c11ae0bacee4ab835526a7408f619a754b3b848e (diff) | |
parent | 23da66bb402cc6d9bca2eb34e090ccc24dfbf3f5 (diff) |
Merge pull request #722 from keszybz/networkd-clarifications
Networkd clarifications
-rw-r--r-- | man/systemd.netdev.xml | 15 | ||||
-rw-r--r-- | man/systemd.network.xml | 51 | ||||
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-types.c | 20 | ||||
-rw-r--r-- | src/network/networkd-link.c | 4 | ||||
-rw-r--r-- | src/network/networkd-netdev-gperf.gperf | 2 | ||||
-rw-r--r-- | src/network/networkd-netdev-tunnel.c | 2 | ||||
-rw-r--r-- | src/network/networkd-netdev-tunnel.h | 2 | ||||
-rw-r--r-- | src/network/networkd-network-gperf.gperf | 4 | ||||
-rw-r--r-- | src/network/networkd-network.c | 4 | ||||
-rw-r--r-- | src/network/networkd.h | 4 |
10 files changed, 57 insertions, 51 deletions
diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index b100f96b85..7e92d1d99c 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -504,13 +504,14 @@ </listitem> </varlistentry> <varlistentry> - <term><varname>DiffServiceCodePoint=</varname></term> - <listitem> - <para>A boolean. When true, inherits the Differentiated - Service Code Point (DSCP) field between inner and outer - header for ip6_tunnel. DSCP is a field in an IP packet - that enables different levels of service to be assigned - to network traffic. Defaults to <literal>no</literal>. + <term><varname>CopyDSCP=</varname></term> + <listitem> + <para>A boolean. When true, the Differentiated Service Code + Point (DSCP) field will be copied to the inner header from + outer header during the decapsulation of an IPv6 tunnel + packet. DSCP is a field in an IP packet that enables different + levels of service to be assigned to network traffic. + Defaults to <literal>no</literal>. </para> </listitem> </varlistentry> diff --git a/man/systemd.network.xml b/man/systemd.network.xml index d654db4993..fbb0bef5c2 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -576,22 +576,23 @@ <varlistentry> <term><varname>SendHostname=</varname></term> <listitem> - <para>When true (the default), the machine's hostname will be sent to the DHCP - server</para> + <para>When true (the default), the machine's hostname will + be sent to the DHCP server.</para> </listitem> </varlistentry> <varlistentry> <term><varname>UseHostname=</varname></term> <listitem> <para>When true (the default), the hostname received from - the DHCP server will be used as the transient - hostname.</para> + the DHCP server will be used as the transient hostname. + </para> </listitem> </varlistentry> <varlistentry> <term><varname>Hostname=</varname></term> <listitem> - <para>Hostname is a option to override the machine's hostname that will be sent to the DHCP server</para> + <para>Use this value for the hostname which is sent to the + DHCP server, instead of machine's hostname.</para> </listitem> </varlistentry> <varlistentry> @@ -671,51 +672,51 @@ <varlistentry> <term><varname>UnicastFlood=</varname></term> <listitem> - <para>A boolean. UnicastFlood configures whether a given port will flood - unicast traffic for which there is no FDB entry. By default this - flag is off.</para> + <para>A boolean. Controls whether the bridge should flood + traffic for which an FDB entry is missing and the destination + is unknown through this port. Defaults to on. + </para> </listitem> </varlistentry> <varlistentry> <term><varname>HairPin=</varname></term> <listitem> - <para> A boolean. Configures whether traffic may be send back - out of the port on which it was received. By default, this - flag is false. and the bridge will not forward traffic back - out of the receiving port. By default the flag is off.</para> + <para>A boolean. Configures whether traffic may be sent back + out of the port on which it was received. By default, this + flag is false, and the bridge will not forward traffic back + out of the receiving port.</para> </listitem> </varlistentry> <varlistentry> - <term><varname>BPDUGuard=</varname></term> + <term><varname>UseBPDU=</varname></term> <listitem> - <para> A boolean. Configures whether STP Bridge Protocol Data Units will be - processed by the bridge port. By default, the flag is false allowing BPDU - processing. Turning this flag on will cause the port to stop processing - STP Bridge Protocol Data Units. By default the flag is off.</para> + <para>A boolean. Configures whether STP Bridge Protocol Data Units will be + processed by the bridge port. Defaults to yes.</para> </listitem> </varlistentry> <varlistentry> <term><varname>FastLeave=</varname></term> <listitem> - <para> A boolean. This flag allows the bridge to immediately stop multicast + <para>A boolean. This flag allows the bridge to immediately stop multicast traffic on a port that receives IGMP Leave message. It is only used with - IGMP snooping if enabled on the bridge. By default the flag is off.</para> + IGMP snooping if enabled on the bridge. Defaults to off.</para> </listitem> </varlistentry> <varlistentry> - <term><varname>RootBlock=</varname></term> + <term><varname>AllowPortToBeRoot=</varname></term> <listitem> - <para> A boolean. Configures whether a given port is allowed to - become root port or not. Only used when STP is enabled on the bridge. - By default the flag is off.</para> + <para>A boolean. Configures whether a given port is allowed to + become a root port. Only used when STP is enabled on the bridge. + Defaults to on.</para> </listitem> </varlistentry> <varlistentry> <term><varname>Cost=</varname></term> <listitem> - <para>Each port in a bridge may have different speed. Cost + <para>Sets the "cost" of sending packets of this interface. + Each port in a bridge may have different speed and the cost is used to decide which link to use. Faster interfaces - should have lower costs</para> + should have lower costs.</para> </listitem> </varlistentry> </variablelist> diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c index ff1b8a260f..9b68935245 100644 --- a/src/libsystemd/sd-netlink/netlink-types.c +++ b/src/libsystemd/sd-netlink/netlink-types.c @@ -196,10 +196,10 @@ static const NLType rtnl_link_info_data_iptun_types[IFLA_IPTUN_MAX + 1] = { [IFLA_IPTUN_6RD_RELAY_PREFIX] = { .type = NETLINK_TYPE_U32 }, [IFLA_IPTUN_6RD_PREFIXLEN] = { .type = NETLINK_TYPE_U16 }, [IFLA_IPTUN_6RD_RELAY_PREFIXLEN] = { .type = NETLINK_TYPE_U16 }, - [IFLA_IPTUN_ENCAP_TYPE] = { .type = NETLINK_TYPE_U16}, - [IFLA_IPTUN_ENCAP_FLAGS] = { .type = NETLINK_TYPE_U16}, - [IFLA_IPTUN_ENCAP_SPORT] = { .type = NETLINK_TYPE_U16}, - [IFLA_IPTUN_ENCAP_DPORT] = { .type = NETLINK_TYPE_U16}, + [IFLA_IPTUN_ENCAP_TYPE] = { .type = NETLINK_TYPE_U16 }, + [IFLA_IPTUN_ENCAP_FLAGS] = { .type = NETLINK_TYPE_U16 }, + [IFLA_IPTUN_ENCAP_SPORT] = { .type = NETLINK_TYPE_U16 }, + [IFLA_IPTUN_ENCAP_DPORT] = { .type = NETLINK_TYPE_U16 }, }; static const NLType rtnl_link_info_data_ipgre_types[IFLA_GRE_MAX + 1] = { @@ -225,8 +225,8 @@ static const NLType rtnl_link_info_data_ipvti_types[IFLA_VTI_MAX + 1] = { [IFLA_VTI_LINK] = { .type = NETLINK_TYPE_U32 }, [IFLA_VTI_IKEY] = { .type = NETLINK_TYPE_U32 }, [IFLA_VTI_OKEY] = { .type = NETLINK_TYPE_U32 }, - [IFLA_VTI_LOCAL] = { .type = NETLINK_TYPE_IN_ADDR }, - [IFLA_VTI_REMOTE] = { .type = NETLINK_TYPE_IN_ADDR }, + [IFLA_VTI_LOCAL] = { .type = NETLINK_TYPE_IN_ADDR }, + [IFLA_VTI_REMOTE] = { .type = NETLINK_TYPE_IN_ADDR }, }; static const NLType rtnl_link_info_data_ip6tnl_types[IFLA_IPTUN_MAX + 1] = { @@ -237,7 +237,7 @@ static const NLType rtnl_link_info_data_ip6tnl_types[IFLA_IPTUN_MAX + 1] = { [IFLA_IPTUN_FLAGS] = { .type = NETLINK_TYPE_U32 }, [IFLA_IPTUN_PROTO] = { .type = NETLINK_TYPE_U8 }, [IFLA_IPTUN_ENCAP_LIMIT] = { .type = NETLINK_TYPE_U8 }, - [IFLA_IPTUN_FLOWINFO] = { .type = NETLINK_TYPE_U32}, + [IFLA_IPTUN_FLOWINFO] = { .type = NETLINK_TYPE_U32 }, }; /* these strings must match the .kind entries in the kernel */ @@ -375,9 +375,9 @@ static const NLTypeSystem rtnl_af_spec_type_system = { }; static const NLType rtnl_link_types[IFLA_MAX + 1 ] = { - [IFLA_ADDRESS] = { .type = NETLINK_TYPE_ETHER_ADDR, }, - [IFLA_BROADCAST] = { .type = NETLINK_TYPE_ETHER_ADDR, }, - [IFLA_IFNAME] = { .type = NETLINK_TYPE_STRING, .size = IFNAMSIZ - 1, }, + [IFLA_ADDRESS] = { .type = NETLINK_TYPE_ETHER_ADDR }, + [IFLA_BROADCAST] = { .type = NETLINK_TYPE_ETHER_ADDR }, + [IFLA_IFNAME] = { .type = NETLINK_TYPE_STRING, .size = IFNAMSIZ - 1 }, [IFLA_MTU] = { .type = NETLINK_TYPE_U32 }, [IFLA_LINK] = { .type = NETLINK_TYPE_U32 }, /* diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 55510b46e9..f20f68b482 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -858,7 +858,7 @@ static int link_set_bridge(Link *link) { if (r < 0) return log_link_error_errno(link, r, "Could not append IFLA_PROTINFO attribute: %m"); - r = sd_netlink_message_append_u8(req, IFLA_BRPORT_GUARD, link->network->bpdu_guard); + r = sd_netlink_message_append_u8(req, IFLA_BRPORT_GUARD, !link->network->use_bpdu); if (r < 0) return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_GUARD attribute: %m"); @@ -870,7 +870,7 @@ static int link_set_bridge(Link *link) { if (r < 0) return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_FAST_LEAVE attribute: %m"); - r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROTECT, link->network->root_block); + r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROTECT, !link->network->allow_port_to_be_root); if (r < 0) return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_PROTECT attribute: %m"); diff --git a/src/network/networkd-netdev-gperf.gperf b/src/network/networkd-netdev-gperf.gperf index bdc43e87f6..be76022bc7 100644 --- a/src/network/networkd-netdev-gperf.gperf +++ b/src/network/networkd-netdev-gperf.gperf @@ -37,7 +37,7 @@ Tunnel.TTL, config_parse_unsigned, 0, Tunnel.DiscoverPathMTU, config_parse_bool, 0, offsetof(Tunnel, pmtudisc) Tunnel.Mode, config_parse_ip6tnl_mode, 0, offsetof(Tunnel, ip6tnl_mode) Tunnel.IPv6FlowLabel, config_parse_ipv6_flowlabel, 0, offsetof(Tunnel, ipv6_flowlabel) -Tunnel.DiffServiceCodePoint, config_parse_bool, 0, offsetof(Tunnel, dscp) +Tunnel.CopyDSCP, config_parse_bool, 0, offsetof(Tunnel, copy_dscp) Peer.Name, config_parse_ifname, 0, offsetof(Veth, ifname_peer) Peer.MACAddress, config_parse_hwaddr, 0, offsetof(Veth, mac_peer) VXLAN.Id, config_parse_uint64, 0, offsetof(VxLan, id) diff --git a/src/network/networkd-netdev-tunnel.c b/src/network/networkd-netdev-tunnel.c index 1af234aba3..7fd9ef584b 100644 --- a/src/network/networkd-netdev-tunnel.c +++ b/src/network/networkd-netdev-tunnel.c @@ -281,7 +281,7 @@ static int netdev_ip6tnl_fill_message_create(NetDev *netdev, Link *link, sd_netl return log_netdev_error_errno(netdev, r, "Could not append IFLA_IPTUN_FLOWINFO attribute: %m"); } - if (t->dscp) + if (t->copy_dscp) t->flags |= IP6_TNL_F_RCV_DSCP_COPY; r = sd_netlink_message_append_u32(m, IFLA_IPTUN_FLAGS, t->flags); diff --git a/src/network/networkd-netdev-tunnel.h b/src/network/networkd-netdev-tunnel.h index e08e2891e7..1fd2b94ae1 100644 --- a/src/network/networkd-netdev-tunnel.h +++ b/src/network/networkd-netdev-tunnel.h @@ -57,7 +57,7 @@ struct Tunnel { IPv6FlowLabel ipv6_flowlabel; bool pmtudisc; - bool dscp; + bool copy_dscp; }; extern const NetDevVTable ipip_vtable; diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 720f6b9d0b..83224d7109 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -73,10 +73,10 @@ DHCP.CriticalConnection, config_parse_bool, 0 DHCP.VendorClassIdentifier, config_parse_string, 0, offsetof(Network, dhcp_vendor_class_identifier) DHCP.RouteMetric, config_parse_unsigned, 0, offsetof(Network, dhcp_route_metric) Bridge.Cost, config_parse_unsigned, 0, offsetof(Network, cost) -Bridge.BPDUGuard, config_parse_bool, 0, offsetof(Network, bpdu_guard) +Bridge.UseBPDU, config_parse_bool, 0, offsetof(Network, use_bpdu) Bridge.HairPin, config_parse_bool, 0, offsetof(Network, hairpin) Bridge.FastLeave, config_parse_bool, 0, offsetof(Network, fast_leave) -Bridge.RootBlock, config_parse_bool, 0, offsetof(Network, root_block) +Bridge.AllowPortToBeRoot, config_parse_bool, 0, offsetof(Network, allow_port_to_be_root) Bridge.UnicastFlood, config_parse_bool, 0, offsetof(Network, unicast_flood) BridgeFDB.MACAddress, config_parse_fdb_hwaddr, 0, 0 BridgeFDB.VLANId, config_parse_fdb_vlan_id, 0, 0 diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 55e735e6bf..d8f42621af 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -107,6 +107,10 @@ static int network_load_one(Manager *manager, const char *filename) { network->dhcp_route_metric = DHCP_ROUTE_METRIC; network->dhcp_client_identifier = DHCP_CLIENT_ID_DUID; + network->use_bpdu = true; + network->allow_port_to_be_root = true; + network->unicast_flood = true; + network->llmnr = LLMNR_SUPPORT_YES; network->link_local = ADDRESS_FAMILY_IPV6; diff --git a/src/network/networkd.h b/src/network/networkd.h index 6418c0a536..a285a4b08f 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -150,10 +150,10 @@ struct Network { bool dhcp_server; - bool bpdu_guard; + bool use_bpdu; bool hairpin; bool fast_leave; - bool root_block; + bool allow_port_to_be_root; bool unicast_flood; unsigned cost; |