-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
network: add ModemManager support #22315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
fb8a7c5 to
1250c2e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This pull request introduces 1 alert when merging 9facc68 into 9d67fb0 - view on LGTM.com new alerts:
|
|
needs a rebase |
16285b8 to
c76525e
Compare
keszybz
left a comment
There was a problem hiding this 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?
| 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| 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."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
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.
Heavily based on systemd#22315 by Yu Watanabe. Upstream-Status: Inappropriate [Inappropriate]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Closes #20370.