Martin Schwenke has uploaded this change for review. (
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1227749?usp=email )
Change subject: D-Bus: Improve argument checking, drop default recovery/grace event
......................................................................
D-Bus: Improve argument checking, drop default recovery/grace event
Do argument checking at the highest possible level instead of dealing
with it down in the depths, where some errors are currently ignored.
Currently, if just an IP address is supplied then the default event is
TAKE_IP. However, this causes ambiguity when used with IPv6 due to
the use of colon (':') as a separator.
For example, 2:ab:cd::42 can logically mean 2 completely different
things:
* Event 2 (RELEASE_IP) with IP address ab:cd::42
* Default event 5 (TAKE_IP) with IP address 2:ab:cd::42
Also, currently specifying 0 (without a trailing colon, attempting to
mean JUST_GRACE) currently causes a TAKE_IP for IP address 0.0.0.0.
This doesn't obey the principle of least surprise.
The behaviour is changed to make the event mandatory. This way, the
colon (':') separator should indicate the presence of a mandatory
argument for the event. However, this would break backward
compatibility for many users, so an empty argument (e.g. "0:") is
treated the same as a missing argument (i.e. no colon-separator).
The result of the IP address parse is currently unused. Using it
would over-complicate this commit and it can be done in an additional
commit with minimal churn.
Signed-off-by: Martin Schwenke <mschwenke(a)ddn.com>
Change-Id: Ia03f9217385a45cb65121d966abb6e6e757abcd3
---
M src/MainNFSD/nfs_admin_thread.c
1 file changed, 62 insertions(+), 19 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/49/1227749/1
--
To view, visit
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1227749?usp=email
To unsubscribe, or for help writing mail filters, visit
https://review.gerrithub.io/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: Ia03f9217385a45cb65121d966abb6e6e757abcd3
Gerrit-Change-Number: 1227749
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Schwenke <martin(a)meltin.net>