net/slirp: fix the error message when the prefix len is invalid
PATCH 1/1 net/slirp: fix the error message when the prefix len is invalid
Add a missing parentheses at the end of the error message, when we have an invalid prefix len.
--- net/slirp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/slirp.c +2 -1
@@ -498,7 +498,8 @@ static int net_slirp_init(NetClientState *peer, const char *model, }if (vprefix6_len <0 || vprefix6_len >126 ) {error_setg (errp, -"Invalid prefix provided (prefix len must be in range 0-126" ); +"Invalid prefix provided " +"(prefix len must be in range 0-126)" );return -1 ; }
Signature · 1 line
2.20.1
Quoted 5 lines · Stefano Garzarella
Add a missing parentheses at the end of the error message, when we have an invalid prefix len.
Signed-off-by Stefano Garzarella <[email protected]>
Quoted 22 lines
--- net/slirp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/slirp.c +2
-2@@ -498,7 +498,8 @@ static int net_slirp_init(NetClientState *peer, const char *model, }if (vprefix6_len <0 || vprefix6_len >126 ) {error_setg (errp, -"Invalid prefix provided (prefix len must be in range 0-126" ); +"Invalid prefix provided " +"(prefix len must be in range 0-126)" );return -1 ; } --2.20.1
Signature · 1 line
Marc-André Lureau
Quoted 13 lines · Stefano Garzarella
Add a missing parentheses at the end of the error message, when we have an invalid prefix len.
Signed-off-by Stefano Garzarella <[email protected]>--- net/slirp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/slirp.c +0
-0
net/slirp.c static int net_slirp_init(NetClientState *peer, const char *model, · line 504
Quoted 8 lines
net/slirp.c +2
-1@@ -498,7 +498,8 @@ static int net_slirp_init(NetClientState *peer, const char *model, }if (vprefix6_len <0 || vprefix6_len >126 ) {error_setg (errp, -"Invalid prefix provided (prefix len must be in range 0-126" ); +"Invalid prefix provided " +"(prefix len must be in range 0-126)" );return -1 ; }
Preexisting: the error message fails to identify the offending parameter. The user needs to make the connection to "ipv6-prefixlen" based on the fact that the only parameters with "prefix" in name or description are "ipv6-prefix" and "ipv6-prefixlen", and only the latter is a length.
What about "Parameter 'ipv6-prefixlen' expects a length below 127", or "Parameter 'ipv6-prefixlen' expects a value between 0 and 126"?
Quoted 30 lines · Markus Armbruster
Quoted 13 lines · Stefano Garzarella
Add a missing parentheses at the end of the error message, when we have an invalid prefix len.
Signed-off-by Stefano Garzarella <[email protected]>--- net/slirp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/slirp.c +0
-0net/slirp.c static int net_slirp_init(NetClientState *peer, const char *model, · line 504
Quoted 8 lines
net/slirp.c +2
-1@@ -498,7 +498,8 @@ static int net_slirp_init(NetClientState *peer, const char *model, }if (vprefix6_len <0 || vprefix6_len >126 ) {error_setg (errp, -"Invalid prefix provided (prefix len must be in range 0-126" ); +"Invalid prefix provided " +"(prefix len must be in range 0-126)" );return -1 ; }Preexisting: the error message fails to identify the offending parameter. The user needs to make the connection to "ipv6-prefixlen" based on the fact that the only parameters with "prefix" in name or description are "ipv6-prefix" and "ipv6-prefixlen", and only the latter is a length.
Quoted 2 lines
What about "Parameter 'ipv6-prefixlen' expects a length below 127", or "Parameter 'ipv6-prefixlen' expects a value between 0 and 126"?
"Parameter 'ipv6-prefixlen' expects a value between 0 and 126" should be fine.
Otherwise, since other errors didn't refer to the parameter name, we can simply add IPv6 in this way:
"Invalid IPv6 prefix provided (IPv6 prefix len must be between 0 and 126)"
But I'm fine also with your proposal.
Thanks,
Stefano
Quoted 34 lines · Stefano Garzarella
Quoted 30 lines · Markus Armbruster
Quoted 13 lines · Stefano Garzarella
Add a missing parentheses at the end of the error message, when we have an invalid prefix len.
Signed-off-by Stefano Garzarella <[email protected]>--- net/slirp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/slirp.c +0
-0net/slirp.c static int net_slirp_init(NetClientState *peer, const char *model, · line 504
Quoted 8 lines
net/slirp.c +2
-1@@ -498,7 +498,8 @@ static int net_slirp_init(NetClientState *peer, const char *model, }if (vprefix6_len <0 || vprefix6_len >126 ) {error_setg (errp, -"Invalid prefix provided (prefix len must be in range 0-126" ); +"Invalid prefix provided " +"(prefix len must be in range 0-126)" );return -1 ; }Preexisting: the error message fails to identify the offending parameter. The user needs to make the connection to "ipv6-prefixlen" based on the fact that the only parameters with "prefix" in name or description are "ipv6-prefix" and "ipv6-prefixlen", and only the latter is a length.
Quoted 2 lines
What about "Parameter 'ipv6-prefixlen' expects a length below 127", or "Parameter 'ipv6-prefixlen' expects a value between 0 and 126"?
Quoted 6 lines
"Parameter 'ipv6-prefixlen' expects a value between 0 and 126" should be fine.
Otherwise, since other errors didn't refer to the parameter name, we can simply add IPv6 in this way:
"Invalid IPv6 prefix provided (IPv6 prefix len must be between 0 and 126)"
"len" is not a word. Either say "ipv6-prefixlen", or say "IPv6 prefix length".
Quoted 1 line
But I'm fine also with your proposal.
It's just a suggestion. Feel free to leave the error messages consistently vague (apply your patch as is), improve just this one, or improve more messages.
Quoted 43 lines · Markus Armbruster
Quoted 34 lines · Stefano Garzarella
Quoted 30 lines · Markus Armbruster
Quoted 13 lines · Stefano Garzarella
Add a missing parentheses at the end of the error message, when we have an invalid prefix len.
Signed-off-by Stefano Garzarella <[email protected]>--- net/slirp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/slirp.c +0
-0net/slirp.c static int net_slirp_init(NetClientState *peer, const char *model, · line 504
Quoted 8 lines
net/slirp.c +2
-1@@ -498,7 +498,8 @@ static int net_slirp_init(NetClientState *peer, const char *model, }if (vprefix6_len <0 || vprefix6_len >126 ) {error_setg (errp, -"Invalid prefix provided (prefix len must be in range 0-126" ); +"Invalid prefix provided " +"(prefix len must be in range 0-126)" );return -1 ; }Preexisting: the error message fails to identify the offending parameter. The user needs to make the connection to "ipv6-prefixlen" based on the fact that the only parameters with "prefix" in name or description are "ipv6-prefix" and "ipv6-prefixlen", and only the latter is a length.
Quoted 2 lines
What about "Parameter 'ipv6-prefixlen' expects a length below 127", or "Parameter 'ipv6-prefixlen' expects a value between 0 and 126"?
Quoted 6 lines
"Parameter 'ipv6-prefixlen' expects a value between 0 and 126" should be fine.
Otherwise, since other errors didn't refer to the parameter name, we can simply add IPv6 in this way:
"Invalid IPv6 prefix provided (IPv6 prefix len must be between 0 and 126)"
Quoted 8 lines
"len" is not a word. Either say "ipv6-prefixlen", or say "IPv6 prefix length".
Quoted 1 line
But I'm fine also with your proposal.
It's just a suggestion. Feel free to leave the error messages consistently vague (apply your patch as is), improve just this one, or improve more messages.
Your suggestions are very appreciated!
I'll resend this patch fixing this error message and I'll check also the other messages.
Thanks,
Stefano