Adding support to ipv*.route-metric
ClosedPublic

Authored by pvillani on Jul 13 2017, 4:47 PM.

Details

Summary

Adding support to ipv4.route-metric and ipv6.route-metric

Test Plan

Compiled and tested

Diff Detail

Repository
R282 NetworkManagerQt
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
pvillani created this revision.Jul 13 2017, 4:47 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 13 2017, 4:47 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript

Sorry if something are missing, its my first pull request, let me know if any change are needed. I've tested and it's working fine.

pvillani edited reviewers, added: lvsouza; removed: Frameworks.Jul 13 2017, 5:04 PM
jgrulich accepted this revision.Jul 14 2017, 5:26 AM

Looks good to me. If you can also remove this property from the TODO list that would be great.

Btw. there is the same property missing in IPv6Setting in case you would like to do the same for IPv6.

This revision is now accepted and ready to land.Jul 14 2017, 5:26 AM
pvillani updated this revision to Diff 16697.EditedJul 14 2017, 11:38 AM
pvillani retitled this revision from Adding support to ipv4.route-metric to Adding support to ipv*.route-metric.
pvillani edited the summary of this revision. (Show Details)
pvillani edited the test plan for this revision. (Show Details)

Adding support to ipv6.route-metrics.
TODO updated.

pvillani requested review of this revision.Jul 14 2017, 11:46 AM
pvillani edited edge metadata.
jgrulich accepted this revision.Jul 14 2017, 1:45 PM

Looks good, thank you so much.

src/settings/ipv6setting.cpp
412

Missing space between if and bracket.

This revision is now accepted and ready to land.Jul 14 2017, 1:45 PM
lvsouza requested changes to this revision.Jul 14 2017, 8:16 PM

The summary says this patch adds route metric support to IPv4 too, but no IPv4 file is touched by this patch. Have you missed the IPv4 changes?

src/settings/ipv6setting.cpp
412

You could have added a comment stating that according to NetworkManager's documentation zero is not a possible value for IPv6's route metric (the value is automatically changed to 1024 when trying to set it to zero).

This revision now requires changes to proceed.Jul 14 2017, 8:16 PM
pvillani updated this revision to Diff 16836.Jul 17 2017, 4:38 PM
pvillani edited edge metadata.

Adding missing files and making possible to set route-metric as 0, as described in NetworkManager documentation.

pvillani added a comment.EditedJul 17 2017, 4:56 PM

The summary says this patch adds route metric support to IPv4 too, but no IPv4 file is touched by this patch. Have you missed the IPv4 changes?

Added the missing files.
About your comment suggestion, I preferred to change the code and accept the value 0, so that it works as specified by the documentation. In the case of ipv6, value 0 is accepted, but will be coerced to 1024. For IPv4, zero is a regular value for the metric.

Looks good to me now, it looked to me good even before, but didn't read carefully the documentation. Lamarque, do you see anything else?

src/settings/ipv4setting.cpp
455

Missing space between if and bracket.

lvsouza accepted this revision.Jul 18 2017, 9:27 PM
This revision is now accepted and ready to land.Jul 18 2017, 9:27 PM
This revision was automatically updated to reflect the committed changes.