1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 20:25:25 +03:00

Merge pull request #722 from keszybz/networkd-clarifications

Networkd clarifications
This commit is contained in:
Daniel Mack 2015-07-25 10:48:43 +02:00
commit 3460810e8c
10 changed files with 56 additions and 50 deletions

View File

@ -504,13 +504,14 @@
</listitem>
</varlistentry>
<varlistentry>
<term><varname>DiffServiceCodePoint=</varname></term>
<term><varname>CopyDSCP=</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>.
<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>

View File

@ -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>

View File

@ -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 },
/*

View File

@ -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");

View File

@ -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)

View File

@ -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);

View File

@ -57,7 +57,7 @@ struct Tunnel {
IPv6FlowLabel ipv6_flowlabel;
bool pmtudisc;
bool dscp;
bool copy_dscp;
};
extern const NetDevVTable ipip_vtable;

View File

@ -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

View File

@ -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;

View File

@ -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;