wireguard: Trim IP list before submitting to NM

Authored by Haochen Tong <i@hexchain.org> on Feb 27 2020, 6:52 AM.

Description

wireguard: Trim IP list before submitting to NM

Summary:
The SimpleIpListValidator validates each trimmed item in a comma-separated
list, but WireGuardPeerWidget sets peerData without trimming each item.
Untrimmed items are not accepted by NetworkManager, so the user might see NM
rejecting values that are valid in the peer settings dialog.

Fix this discrepancy by trimming each item before setting peerData.

Test Plan:

  1. Type a comma-separated list of IP addresses, with spaces around comma, into

the "Allowed IPs" field of the WireGuard peer settings dialog.

  1. Save the connection. No error should be reported by NM.

Reviewers: jgrulich

Reviewed By: jgrulich

Subscribers: usta, plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D27661

Details

Committed
jgrulichFeb 27 2020, 6:52 AM
Reviewer
jgrulich
Differential Revision
D27661: wireguard: Trim IP list before submitting to NM
Parents
R116:764cb342ea1b: Support WPA3-SAE in the applet popup
Branches
Unknown
Tags
Unknown