Compare commits

..

No commits in common. "08c588d18b1e337f856e6541f3f711be48718279" and "f12d19b30447a771ba6dd551ac05a4ba6de2a976" have entirely different histories.

8 changed files with 13 additions and 44 deletions

View File

@ -2317,16 +2317,6 @@
the value of a received bit by majority rule. When unset, the kernel's default will be used.</para> the value of a received bit by majority rule. When unset, the kernel's default will be used.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>ListenOnly=</varname></term>
<listitem>
<para>Takes a boolean. When <literal>yes</literal>, listen-only mode is enabled. When the
interface is in listen-only mode, the interface neither transmit CAN frames nor send ACK
bit. Listen-only mode is important to debug CAN networks without interfering with the
communication or acknowledge the CAN frame. When unset, the kernel's default will be used.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>

View File

@ -120,7 +120,6 @@ typedef struct LinkInfo {
unsigned short iftype; unsigned short iftype;
struct ether_addr mac_address; struct ether_addr mac_address;
struct ether_addr permanent_mac_address; struct ether_addr permanent_mac_address;
uint32_t master;
uint32_t mtu; uint32_t mtu;
uint32_t min_mtu; uint32_t min_mtu;
uint32_t max_mtu; uint32_t max_mtu;
@ -343,8 +342,6 @@ static int decode_link(sd_netlink_message *m, LinkInfo *info, char **patterns, b
return log_oom(); return log_oom();
} }
(void) sd_netlink_message_read_u32(m, IFLA_MASTER, &info->master);
/* fill kind info */ /* fill kind info */
(void) decode_netdev(m, info); (void) decode_netdev(m, info);
@ -1357,15 +1354,6 @@ static int link_status_one(
return table_log_add_error(r); return table_log_add_error(r);
} }
if (info->master > 0) {
r = table_add_many(table,
TABLE_EMPTY,
TABLE_STRING, "Master:",
TABLE_IFINDEX, info->master);
if (r < 0)
return table_log_add_error(r);
}
if (streq_ptr(info->netdev_kind, "bridge")) { if (streq_ptr(info->netdev_kind, "bridge")) {
r = table_add_many(table, r = table_add_many(table,
TABLE_EMPTY, TABLE_EMPTY,

View File

@ -71,7 +71,6 @@ static int link_set_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link)
static int link_set_can(Link *link) { static int link_set_can(Link *link) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL; _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL;
struct can_ctrlmode cm = {};
int r; int r;
assert(link); assert(link);
@ -143,18 +142,13 @@ static int link_set_can(Link *link) {
} }
if (link->network->can_triple_sampling >= 0) { if (link->network->can_triple_sampling >= 0) {
cm.mask |= CAN_CTRLMODE_3_SAMPLES; struct can_ctrlmode cm = {
SET_FLAG(cm.flags, CAN_CTRLMODE_3_SAMPLES, link->network->can_triple_sampling); .mask = CAN_CTRLMODE_3_SAMPLES,
.flags = link->network->can_triple_sampling ? CAN_CTRLMODE_3_SAMPLES : 0,
};
log_link_debug(link, "%sabling triple-sampling", link->network->can_triple_sampling ? "En" : "Dis"); log_link_debug(link, "%sabling triple-sampling", link->network->can_triple_sampling ? "En" : "Dis");
}
if (link->network->can_listen_only >= 0) {
cm.mask |= CAN_CTRLMODE_LISTENONLY;
SET_FLAG(cm.flags, CAN_CTRLMODE_LISTENONLY, link->network->can_listen_only);
log_link_debug(link, "%sabling listen-only mode", link->network->can_listen_only ? "En" : "Dis");
}
if (cm.mask != 0) {
r = sd_netlink_message_append_data(m, IFLA_CAN_CTRLMODE, &cm, sizeof(cm)); r = sd_netlink_message_append_data(m, IFLA_CAN_CTRLMODE, &cm, sizeof(cm));
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "Could not append IFLA_CAN_CTRLMODE attribute: %m"); return log_link_error_errno(link, r, "Could not append IFLA_CAN_CTRLMODE attribute: %m");

View File

@ -1334,11 +1334,11 @@ int dhcp4_configure(Link *link) {
return log_oom(); return log_oom();
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to create DHCP4 client: %m"); return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to create DHCP4 client: %m");
}
r = sd_dhcp_client_attach_event(link->dhcp_client, NULL, 0); r = sd_dhcp_client_attach_event(link->dhcp_client, NULL, 0);
if (r < 0) if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to attach event: %m"); return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to attach event: %m");
}
r = sd_dhcp_client_set_mac(link->dhcp_client, r = sd_dhcp_client_set_mac(link->dhcp_client,
(const uint8_t *) &link->mac, (const uint8_t *) &link->mac,

View File

@ -154,10 +154,6 @@ int ipv4ll_configure(Link *link) {
r = sd_ipv4ll_new(&link->ipv4ll); r = sd_ipv4ll_new(&link->ipv4ll);
if (r < 0) if (r < 0)
return r; return r;
r = sd_ipv4ll_attach_event(link->ipv4ll, NULL, 0);
if (r < 0)
return r;
} }
if (link->sd_device && if (link->sd_device &&
@ -167,6 +163,10 @@ int ipv4ll_configure(Link *link) {
return r; return r;
} }
r = sd_ipv4ll_attach_event(link->ipv4ll, NULL, 0);
if (r < 0)
return r;
r = sd_ipv4ll_set_mac(link->ipv4ll, &link->mac); r = sd_ipv4ll_set_mac(link->ipv4ll, &link->mac);
if (r < 0) if (r < 0)
return r; return r;

View File

@ -256,7 +256,6 @@ CAN.SamplePoint, config_parse_permille,
CAN.RestartSec, config_parse_sec, 0, offsetof(Network, can_restart_us) CAN.RestartSec, config_parse_sec, 0, offsetof(Network, can_restart_us)
CAN.TripleSampling, config_parse_tristate, 0, offsetof(Network, can_triple_sampling) CAN.TripleSampling, config_parse_tristate, 0, offsetof(Network, can_triple_sampling)
CAN.Termination, config_parse_tristate, 0, offsetof(Network, can_termination) CAN.Termination, config_parse_tristate, 0, offsetof(Network, can_termination)
CAN.ListenOnly, config_parse_tristate, 0, offsetof(Network, can_listen_only)
QDisc.Parent, config_parse_qdisc_parent, _QDISC_KIND_INVALID, 0 QDisc.Parent, config_parse_qdisc_parent, _QDISC_KIND_INVALID, 0
QDisc.Handle, config_parse_qdisc_handle, _QDISC_KIND_INVALID, 0 QDisc.Handle, config_parse_qdisc_handle, _QDISC_KIND_INVALID, 0
BFIFO.Parent, config_parse_qdisc_parent, QDISC_KIND_BFIFO, 0 BFIFO.Parent, config_parse_qdisc_parent, QDISC_KIND_BFIFO, 0

View File

@ -200,7 +200,6 @@ struct Network {
usec_t can_restart_us; usec_t can_restart_us;
int can_triple_sampling; int can_triple_sampling;
int can_termination; int can_termination;
int can_listen_only;
AddressFamily ip_forward; AddressFamily ip_forward;
bool ip_masquerade; bool ip_masquerade;

View File

@ -201,7 +201,6 @@ BitRate=
RestartSec= RestartSec=
TripleSampling= TripleSampling=
Termination= Termination=
ListenOnly=
[Address] [Address]
DuplicateAddressDetection= DuplicateAddressDetection=
AutoJoin= AutoJoin=