netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and get_prefix() error messages
@ 2016-03-22 13:02 Varlese, Marco
  2016-03-27 17:35 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Varlese, Marco @ 2016-03-22 13:02 UTC (permalink / raw)
  To: netdev@vger.kernel.org
  Cc: davem@davemloft.net, Jiri Pirko, John Fastabend, jhs@mojatatu.com,
	Szczerbik, PrzemyslawX

An attempt to add invalid address to interface would print "???" string
instead of the address family name.

For example:
$ ip address add 256.10.166.1/24 dev ens8
Error: ??? prefix is expected rather than "256.10.166.1/24".

$ ip neighbor add proxy 2001:db8::g dev ens8
Error: ??? address is expected rather than "2001:db8::g".

With this patch the output will look like:
$ ip address add 256.10.166.1/24 dev ens8
Error: inet prefix is expected rather than "256.10.166.1/24".

$ ip neighbor add proxy 2001:db8::g dev ens8
Error: inet6 address is expected rather than "2001:db8::g".

Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
Signed-off-by: Marco Varlese <marco.varlese@intel.com>
---
lib/utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/utils.c b/lib/utils.c
index fa35f4d..4820de1 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -567,7 +567,7 @@ int get_addr(inet_prefix *dst, const char *arg, int family)
{
        if (get_addr_1(dst, arg, family)) {
                fprintf(stderr, "Error: %s address is expected rather than \"%s\".\n",
-                               family_name(family) ,arg);
+                               family_name(dst->family), arg);
                exit(1);
        }
        return 0;
@@ -581,7 +581,7 @@ int get_prefix(inet_prefix *dst, char *arg, int family)
        }
        if (get_prefix_1(dst, arg, family)) {
                fprintf(stderr, "Error: %s prefix is expected rather than \"%s\".\n",
-                               family_name(family) ,arg);
+                               family_name(dst->family), arg);
                exit(1);
        }
        return 0;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and get_prefix() error messages
  2016-03-22 13:02 [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and get_prefix() error messages Varlese, Marco
@ 2016-03-27 17:35 ` Stephen Hemminger
  2016-03-30  7:19   ` Varlese, Marco
  2016-03-27 18:02 ` Stephen Hemminger
  2016-03-30 23:54 ` Stephen Hemminger
  2 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2016-03-27 17:35 UTC (permalink / raw)
  To: Varlese, Marco
  Cc: netdev@vger.kernel.org, davem@davemloft.net, Jiri Pirko,
	John Fastabend, jhs@mojatatu.com, Szczerbik, PrzemyslawX

On Tue, 22 Mar 2016 13:02:02 +0000
"Varlese, Marco" <marco.varlese@intel.com> wrote:

> An attempt to add invalid address to interface would print "???" string
> instead of the address family name.
> 
> For example:
> $ ip address add 256.10.166.1/24 dev ens8
> Error: ??? prefix is expected rather than "256.10.166.1/24".
> 
> $ ip neighbor add proxy 2001:db8::g dev ens8
> Error: ??? address is expected rather than "2001:db8::g".
> 
> With this patch the output will look like:
> $ ip address add 256.10.166.1/24 dev ens8
> Error: inet prefix is expected rather than "256.10.166.1/24".
> 
> $ ip neighbor add proxy 2001:db8::g dev ens8
> Error: inet6 address is expected rather than "2001:db8::g".
> 
> Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
> Signed-off-by: Marco Varlese <marco.varlese@intel.com>
> ---
> lib/utils.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/utils.c b/lib/utils.c
> index fa35f4d..4820de1 100644
> --- a/lib/utils.c
> +++ b/lib/utils.c
> @@ -567,7 +567,7 @@ int get_addr(inet_prefix *dst, const char *arg, int family)
> {
>         if (get_addr_1(dst, arg, family)) {
>                 fprintf(stderr, "Error: %s address is expected rather than \"%s\".\n",
> -                               family_name(family) ,arg);
> +                               family_name(dst->family), arg);
>                 exit(1);
>         }
>         return 0;
> @@ -581,7 +581,7 @@ int get_prefix(inet_prefix *dst, char *arg, int family)
>         }
>         if (get_prefix_1(dst, arg, family)) {
>                 fprintf(stderr, "Error: %s prefix is expected rather than \"%s\".\n",
> -                               family_name(family) ,arg);
> +                               family_name(dst->family), arg);
>                 exit(1);
>         }
>         return 0;

Your patch was corrupted by your email client?

$ patch -p1 <~/Downloads/iproute2-v1-1-1-lib-utils-fix-get_addr-and-get_prefix-error-messages.patch 
patching file lib/utils.c
patch: **** malformed patch at line 6: {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and get_prefix() error messages
  2016-03-22 13:02 [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and get_prefix() error messages Varlese, Marco
  2016-03-27 17:35 ` Stephen Hemminger
@ 2016-03-27 18:02 ` Stephen Hemminger
  2016-03-30 23:54 ` Stephen Hemminger
  2 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2016-03-27 18:02 UTC (permalink / raw)
  To: Varlese, Marco
  Cc: netdev@vger.kernel.org, davem@davemloft.net, Jiri Pirko,
	John Fastabend, jhs@mojatatu.com, Szczerbik, PrzemyslawX

On Tue, 22 Mar 2016 13:02:02 +0000
"Varlese, Marco" <marco.varlese@intel.com> wrote:

> An attempt to add invalid address to interface would print "???" string
> instead of the address family name.
> 
> For example:
> $ ip address add 256.10.166.1/24 dev ens8
> Error: ??? prefix is expected rather than "256.10.166.1/24".
> 
> $ ip neighbor add proxy 2001:db8::g dev ens8
> Error: ??? address is expected rather than "2001:db8::g".
> 
> With this patch the output will look like:
> $ ip address add 256.10.166.1/24 dev ens8
> Error: inet prefix is expected rather than "256.10.166.1/24".
> 
> $ ip neighbor add proxy 2001:db8::g dev ens8
> Error: inet6 address is expected rather than "2001:db8::g".
> 
> Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
> Signed-off-by: Marco Varlese <marco.varlese@intel.com>

Since this was so trivial, I did change manually since patch was corrupted.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and get_prefix() error messages
  2016-03-27 17:35 ` Stephen Hemminger
@ 2016-03-30  7:19   ` Varlese, Marco
  0 siblings, 0 replies; 6+ messages in thread
From: Varlese, Marco @ 2016-03-30  7:19 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: netdev@vger.kernel.org, davem@davemloft.net, Jiri Pirko,
	John Fastabend, jhs@mojatatu.com, Szczerbik, PrzemyslawX

[-- Attachment #1: Type: text/plain, Size: 2806 bytes --]


> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On Behalf Of Stephen Hemminger
> Sent: Sunday, March 27, 2016 6:35 PM
> To: Varlese, Marco <marco.varlese@intel.com>
> Cc: netdev@vger.kernel.org; davem@davemloft.net; Jiri Pirko
<jiri@resnulli.us>;
> John Fastabend <john.fastabend@gmail.com>; jhs@mojatatu.com; Szczerbik,
> PrzemyslawX <przemyslawx.szczerbik@intel.com>
> Subject: Re: [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and
get_prefix()
> error messages
> 
> On Tue, 22 Mar 2016 13:02:02 +0000
> "Varlese, Marco" <marco.varlese@intel.com> wrote:
> 
> > An attempt to add invalid address to interface would print "???" string
> > instead of the address family name.
> >
> > For example:
> > $ ip address add 256.10.166.1/24 dev ens8
> > Error: ??? prefix is expected rather than "256.10.166.1/24".
> >
> > $ ip neighbor add proxy 2001:db8::g dev ens8
> > Error: ??? address is expected rather than "2001:db8::g".
> >
> > With this patch the output will look like:
> > $ ip address add 256.10.166.1/24 dev ens8
> > Error: inet prefix is expected rather than "256.10.166.1/24".
> >
> > $ ip neighbor add proxy 2001:db8::g dev ens8
> > Error: inet6 address is expected rather than "2001:db8::g".
> >
> > Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
> > Signed-off-by: Marco Varlese <marco.varlese@intel.com>
> > ---
> > lib/utils.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/utils.c b/lib/utils.c
> > index fa35f4d..4820de1 100644
> > --- a/lib/utils.c
> > +++ b/lib/utils.c
> > @@ -567,7 +567,7 @@ int get_addr(inet_prefix *dst, const char *arg, int
> family)
> > {
> >         if (get_addr_1(dst, arg, family)) {
> >                 fprintf(stderr, "Error: %s address is expected rather than
\"%s\".\n",
> > -                               family_name(family) ,arg);
> > +                               family_name(dst->family), arg);
> >                 exit(1);
> >         }
> >         return 0;
> > @@ -581,7 +581,7 @@ int get_prefix(inet_prefix *dst, char *arg, int family)
> >         }
> >         if (get_prefix_1(dst, arg, family)) {
> >                 fprintf(stderr, "Error: %s prefix is expected rather than
\"%s\".\n",
> > -                               family_name(family) ,arg);
> > +                               family_name(dst->family), arg);
> >                 exit(1);
> >         }
> >         return 0;
> 
> Your patch was corrupted by your email client?
Yes, you're right; the patch got corrupted by the email client.
Sorry about that.
Looking into this now.

> 
> $ patch -p1
<~/Downloads/iproute2-v1-1-1-lib-utils-fix-get_addr-and-get_prefix-
> error-messages.patch
> patching file lib/utils.c
> patch: **** malformed patch at line 6: {

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 4414 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and get_prefix() error messages
  2016-03-22 13:02 [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and get_prefix() error messages Varlese, Marco
  2016-03-27 17:35 ` Stephen Hemminger
  2016-03-27 18:02 ` Stephen Hemminger
@ 2016-03-30 23:54 ` Stephen Hemminger
  2016-03-31  8:04   ` Varlese, Marco
  2 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2016-03-30 23:54 UTC (permalink / raw)
  To: Varlese, Marco
  Cc: netdev@vger.kernel.org, davem@davemloft.net, Jiri Pirko,
	John Fastabend, jhs@mojatatu.com, Szczerbik, PrzemyslawX

On Tue, 22 Mar 2016 13:02:02 +0000
"Varlese, Marco" <marco.varlese@intel.com> wrote:

> An attempt to add invalid address to interface would print "???" string
> instead of the address family name.
> 
> For example:
> $ ip address add 256.10.166.1/24 dev ens8
> Error: ??? prefix is expected rather than "256.10.166.1/24".
> 
> $ ip neighbor add proxy 2001:db8::g dev ens8
> Error: ??? address is expected rather than "2001:db8::g".
> 
> With this patch the output will look like:
> $ ip address add 256.10.166.1/24 dev ens8
> Error: inet prefix is expected rather than "256.10.166.1/24".
> 
> $ ip neighbor add proxy 2001:db8::g dev ens8
> Error: inet6 address is expected rather than "2001:db8::g".
> 
> Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
> Signed-off-by: Marco Varlese <marco.varlese@intel.com>
> ---
> lib/utils.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

If you look at git, I already applied this by manual fix.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and get_prefix() error messages
  2016-03-30 23:54 ` Stephen Hemminger
@ 2016-03-31  8:04   ` Varlese, Marco
  0 siblings, 0 replies; 6+ messages in thread
From: Varlese, Marco @ 2016-03-31  8:04 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: netdev@vger.kernel.org, davem@davemloft.net, Jiri Pirko,
	John Fastabend, jhs@mojatatu.com, Szczerbik, PrzemyslawX

[-- Attachment #1: Type: text/plain, Size: 1571 bytes --]

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Thursday, March 31, 2016 12:54 AM
> To: Varlese, Marco <marco.varlese@intel.com>
> Cc: netdev@vger.kernel.org; davem@davemloft.net; Jiri Pirko
<jiri@resnulli.us>;
> John Fastabend <john.fastabend@gmail.com>; jhs@mojatatu.com; Szczerbik,
> PrzemyslawX <przemyslawx.szczerbik@intel.com>
> Subject: Re: [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and
get_prefix()
> error messages
> 
> On Tue, 22 Mar 2016 13:02:02 +0000
> "Varlese, Marco" <marco.varlese@intel.com> wrote:
> 
> > An attempt to add invalid address to interface would print "???" string
> > instead of the address family name.
> >
> > For example:
> > $ ip address add 256.10.166.1/24 dev ens8
> > Error: ??? prefix is expected rather than "256.10.166.1/24".
> >
> > $ ip neighbor add proxy 2001:db8::g dev ens8
> > Error: ??? address is expected rather than "2001:db8::g".
> >
> > With this patch the output will look like:
> > $ ip address add 256.10.166.1/24 dev ens8
> > Error: inet prefix is expected rather than "256.10.166.1/24".
> >
> > $ ip neighbor add proxy 2001:db8::g dev ens8
> > Error: inet6 address is expected rather than "2001:db8::g".
> >
> > Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
> > Signed-off-by: Marco Varlese <marco.varlese@intel.com>
> > ---
> > lib/utils.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> If you look at git, I already applied this by manual fix.

Thanks, I didn't see your other email. Thank you for your help!

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 4414 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-03-31  8:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 13:02 [PATCH iproute2 v1 1/1] lib/utils: fix get_addr() and get_prefix() error messages Varlese, Marco
2016-03-27 17:35 ` Stephen Hemminger
2016-03-30  7:19   ` Varlese, Marco
2016-03-27 18:02 ` Stephen Hemminger
2016-03-30 23:54 ` Stephen Hemminger
2016-03-31  8:04   ` Varlese, Marco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).