From d59be2cf702dd29d0bb228013cef801f2e9dd22f Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 24 Jul 2015 21:38:24 -0400 Subject: man: reword description of Hostname= Also add dots at the end of sentences. --- man/systemd.network.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/man/systemd.network.xml b/man/systemd.network.xml index d654db4993..0b137ca97d 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -576,22 +576,23 @@ SendHostname= - When true (the default), the machine's hostname will be sent to the DHCP - server + When true (the default), the machine's hostname will + be sent to the DHCP server. UseHostname= When true (the default), the hostname received from - the DHCP server will be used as the transient - hostname. + the DHCP server will be used as the transient hostname. + Hostname= - Hostname is a option to override the machine's hostname that will be sent to the DHCP server + Use this value for the hostname which is sent to the + DHCP server, instead of machine's hostname. -- cgit v1.2.3-54-g00ecf From 6e74cadeef4aedfe2fdea7e4de9e67f29b720671 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 24 Jul 2015 21:41:35 -0400 Subject: netlink-types: use consistent whitespace at EOL Follow up for v222-124-g79e27dbcb1. --- src/libsystemd/sd-netlink/netlink-types.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 }, /* -- cgit v1.2.3-54-g00ecf From 3cf4bcab07c3d6a58251a68b5d969d0a38518209 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 24 Jul 2015 21:57:32 -0400 Subject: man: try to better describe DiffServiceCodePoint= setting http://marc.info/?l=linux-netdev&m=109507453227993&w=2 --- man/systemd.netdev.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index b100f96b85..00d1de30c7 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -506,11 +506,12 @@ DiffServiceCodePoint= - 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 no. + A boolean. When true, the Differentiated Service Code + Point (DSCP) field will be copied to the inner header from + outer header during the decapsulation on 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 no. -- cgit v1.2.3-54-g00ecf From a9b70f9dfd9214ea6934a3ebc1950208eee4d174 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 24 Jul 2015 22:26:00 -0400 Subject: network: rename DiffServiceCodePoint to CopyDSCP Old name was slightly misleading, because this flag does not determine whether DSCP is used overall, but only if it is copied to the decapsulated packet. Rename to better reflect that. "Copy" does not imply direction. This is on purpose, because we might later on enhance the setting to allow/disallow copying in the other direction, to the encapsulated packet. If that is implemented, CopyDSCP could understand additional values. This is nicer than having two separate settings and follows the example of DHCP=. Also, we try to avoid abbreviations, but we allow acronyms like MTU, in DiscoverPathMTU=. This setting was recently added, so it's fine to rename it without backwards compat. --- man/systemd.netdev.xml | 4 ++-- src/network/networkd-netdev-gperf.gperf | 2 +- src/network/networkd-netdev-tunnel.c | 2 +- src/network/networkd-netdev-tunnel.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index 00d1de30c7..7e92d1d99c 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -504,11 +504,11 @@ - DiffServiceCodePoint= + CopyDSCP= A boolean. When true, the Differentiated Service Code Point (DSCP) field will be copied to the inner header from - outer header during the decapsulation on an IPv6 tunnel + 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 no. 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; -- cgit v1.2.3-54-g00ecf From 47c7dfe275b30cb507108f08e471d2d9ef2baa56 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 24 Jul 2015 22:37:04 -0400 Subject: man: reword new Bridge descriptions --- man/systemd.network.xml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 0b137ca97d..85f16e73e6 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -673,50 +673,51 @@ UnicastFlood= 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. + unicast traffic for which there is no FDB entry. Defaults to off. + HairPin= - 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. + 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. BPDUGuard= - A boolean. Configures whether STP Bridge Protocol Data Units will be + 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. + STP Bridge Protocol Data Units. Defaults to off. FastLeave= - A boolean. This flag allows the bridge to immediately stop multicast + 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. + IGMP snooping if enabled on the bridge. Defaults to off. RootBlock= - 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. + 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 off. Cost= - Each port in a bridge may have different speed. Cost + 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 + should have lower costs. -- cgit v1.2.3-54-g00ecf From 84c3409631f48869dcb59c0a74eba6d4ac40ad93 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 24 Jul 2015 22:52:26 -0400 Subject: networkd: rename BPDUGuard to UseBPDU Rename to follow the follow the style of other options. In general "positive" options are preferred to "negative" ones, because they are easier to describe and easier for humans to parse (c.f. the shortening on the man page entry). --- man/systemd.network.xml | 6 ++---- src/network/networkd-link.c | 2 +- src/network/networkd-network-gperf.gperf | 2 +- src/network/networkd-network.c | 2 ++ src/network/networkd.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 85f16e73e6..0dab96d127 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -687,12 +687,10 @@ - BPDUGuard= + UseBPDU= 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. Defaults to off. + processed by the bridge port. Defaults to yes. diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 55510b46e9..54077db486 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"); diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 720f6b9d0b..1416ba1d32 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -73,7 +73,7 @@ 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) diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 55e735e6bf..ff0f72cfe5 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -107,6 +107,8 @@ 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->llmnr = LLMNR_SUPPORT_YES; network->link_local = ADDRESS_FAMILY_IPV6; diff --git a/src/network/networkd.h b/src/network/networkd.h index 6418c0a536..7aade401d8 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -150,7 +150,7 @@ struct Network { bool dhcp_server; - bool bpdu_guard; + bool use_bpdu; bool hairpin; bool fast_leave; bool root_block; -- cgit v1.2.3-54-g00ecf From 072f9e4af4cf465aca6e263f4dfd6e07786786d2 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 24 Jul 2015 23:04:57 -0400 Subject: networkd: turn UnicastFlood on by default Looking at the kernel commit, "on" seems to be the default value: commit 867a59436fc35593ae0e0efcd56cc6d2f8506586 Author: Vlad Yasevich Date: Wed Jun 5 10:08:01 2013 -0400 bridge: Add a flag to control unicast packet flood. Add a flag to control flood of unicast traffic. By default, flood is on and the bridge will flood unicast traffic if it doesn't know the destination. When the flag is turned off, unicast traffic without an FDB will not be forwarded to the specified port. ... and it seems to be the reasonable thing to do by default. --- man/systemd.network.xml | 5 +++-- src/network/networkd-network.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 0dab96d127..196e57dd57 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -672,8 +672,9 @@ UnicastFlood= - A boolean. UnicastFlood configures whether a given port will flood - unicast traffic for which there is no FDB entry. Defaults to off. + 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. diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index ff0f72cfe5..e757219ec5 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -108,6 +108,7 @@ static int network_load_one(Manager *manager, const char *filename) { network->dhcp_client_identifier = DHCP_CLIENT_ID_DUID; network->use_bpdu = true; + network->unicast_flood = true; network->llmnr = LLMNR_SUPPORT_YES; -- cgit v1.2.3-54-g00ecf From 23da66bb402cc6d9bca2eb34e090ccc24dfbf3f5 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 24 Jul 2015 23:12:20 -0400 Subject: networkd: rename RootBlock to AllowPortToBeRoot Justification is similar to BPDUGuard rename. "Positive" values are easier. This is a rather uncommon option, so using a slightly longer name should not be a problem, and may in fact may make it easier to guess what the option does without reading the documentation. --- man/systemd.network.xml | 4 ++-- src/network/networkd-link.c | 2 +- src/network/networkd-network-gperf.gperf | 2 +- src/network/networkd-network.c | 1 + src/network/networkd.h | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 196e57dd57..fbb0bef5c2 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -703,11 +703,11 @@ - RootBlock= + AllowPortToBeRoot= 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 off. + Defaults to on. diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 54077db486..f20f68b482 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -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-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 1416ba1d32..83224d7109 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -76,7 +76,7 @@ Bridge.Cost, config_parse_unsigned, 0 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 e757219ec5..d8f42621af 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -108,6 +108,7 @@ static int network_load_one(Manager *manager, const char *filename) { 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; diff --git a/src/network/networkd.h b/src/network/networkd.h index 7aade401d8..a285a4b08f 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -153,7 +153,7 @@ struct Network { bool use_bpdu; bool hairpin; bool fast_leave; - bool root_block; + bool allow_port_to_be_root; bool unicast_flood; unsigned cost; -- cgit v1.2.3-54-g00ecf