Skip to content

Conversation

@yuwata
Copy link
Member

@yuwata yuwata commented Jan 31, 2022

Closes #20370.

@lgtm-com

This comment has been minimized.

@lgtm-com

This comment has been minimized.

@lgtm-com
Copy link

lgtm-com bot commented Feb 1, 2022

This pull request introduces 1 alert when merging 9facc68 into 9d67fb0 - view on LGTM.com

new alerts:

  • 1 for Use of potentially dangerous function

@bluca
Copy link
Member

bluca commented Feb 18, 2022

needs a rebase

@yuwata yuwata force-pushed the network-wwan branch 2 times, most recently from 16285b8 to c76525e Compare March 12, 2022 12:37
Copy link
Member

@keszybz keszybz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable. I'm a bit surprised that we need to do dbus introspection to figure out the path. @poettering, opinions on that?

Comment on lines +12 to +18
typedef enum {
MM_BEARER_IP_FAMILY_NONE = 0,
MM_BEARER_IP_FAMILY_IPV4 = 1 << 0,
MM_BEARER_IP_FAMILY_IPV6 = 1 << 1,
MM_BEARER_IP_FAMILY_IPV4V6 = 1 << 2,
MM_BEARER_IP_FAMILY_ANY = 0xFFFFFFFF
} MMBearerIpFamily;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to just reuse ADDRESS_FAMILY_* for this? The mapping seems to be 1:1 anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, ADDRESS_FAMILY_YES is 3, not 4.


if (b->connected && b->ip4_method == MM_BEARER_IP_METHOD_DHCP) {
if (!link_dhcp4_enabled(link))
log_link_notice(link, "The WWAN connection requested DHCPv4 client, but it is disabled.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, IIUC, we log notice but otherwise ignore our own config. I think this is not very useful: we should either let our config take priority here, and not call dhcp4_start(), or we should just ignore our own config. Ideally, we would default link->network->dhcp to ADDRESS_FAMILY_ANY if the support for ModemManager is configured. This would make things "just work", but still allow explicit configuration if wanted.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dhcp4_start() does nothing and returns 0 when DHCP4 client is disabled. So, the current implementation is equivalent to the first suggestion.

Comment on lines +333 to +336
if (!link_ipv6_accept_ra_enabled(link) && !link_dhcp6_enabled(link))
log_link_notice(link,
"The WWAN connection requested IPv6 dynamic address configuration,"
"but both IPv6 Router Discovery and DHCPv6 client are disabled.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here, ndisc_start() and dhcp6_start() do nothing if they are disabled.

@bluca bluca modified the milestones: v258, v259 Jun 10, 2025
andr2000 pushed a commit to andr2000/systemd that referenced this pull request Sep 3, 2025
Heavily based on systemd#22315 by Yu Watanabe.

Upstream-Status: Inappropriate [Inappropriate]
andr2000 pushed a commit to andr2000/systemd that referenced this pull request Sep 3, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Upstream-Status: Inappropriate [Inappropriate]
andr2000 pushed a commit to andr2000/systemd that referenced this pull request Sep 4, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Upstream-Status: Inappropriate [Inappropriate]
andr2000 pushed a commit to andr2000/systemd that referenced this pull request Sep 6, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Upstream-Status: Inappropriate [Inappropriate]
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 6, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Upstream-Status: Inappropriate [Inappropriate]
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 6, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Upstream-Status: Inappropriate [Inappropriate]
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 8, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Upstream-Status: Inappropriate [Inappropriate]
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 8, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Upstream-Status: Inappropriate [Inappropriate]
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 8, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Upstream-Status: Inappropriate [Inappropriate]
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 8, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Upstream-Status: Inappropriate [Inappropriate]
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 8, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Upstream-Status: Inappropriate [Inappropriate]
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 9, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 10, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 11, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 15, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 15, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 18, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Sep 18, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no
ModemSimpleConnectProps=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503

[DHCP]
RouteMetric=200

[DHCPv4]
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Nov 6, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectPropertie]s=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Nov 6, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectPropertie]s=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Nov 11, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectPropertie]s=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Nov 11, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectPropertie]s=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
@bluca bluca removed this from the v259 milestone Nov 11, 2025
andr2000 added a commit to andr2000/systemd that referenced this pull request Dec 12, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectProperties=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Dec 15, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectPropertie]s=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Dec 16, 2025
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectPropertie]s=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
andr2000 added a commit to andr2000/systemd that referenced this pull request Jan 7, 2026
Heavily based on systemd#22315 by Yu Watanabe.

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectPropertie]s=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

Integration with ModemManager

10 participants