D27661: wireguard: Trim IP list before submitting to NM

hexchain noreply at phabricator.kde.org
Tue Feb 25 19:56:01 GMT 2020


hexchain created this revision.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
Herald added a reviewer: jgrulich.
hexchain requested review of this revision.

REVISION 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.
  2. Save the connection. No error should be reported by NM.

REPOSITORY
  R116 Plasma Network Management Applet

REVISION DETAIL
  https://phabricator.kde.org/D27661

AFFECTED FILES
  libs/editor/settings/wireguardpeerwidget.cpp

To: hexchain, jgrulich
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200225/1fd9ae01/attachment.html>


More information about the Plasma-devel mailing list