diff mbox

[ovs-dev] netdev-linux: fix warning message

Message ID 1455556461-17935-1-git-send-email-cascardo@redhat.com
State Accepted
Headers show

Commit Message

Thadeu Lima de Souza Cascardo Feb. 15, 2016, 5:14 p.m. UTC
Instead of reading

"error receiving Ethernet packet on Permission denied: ens3",

it should read

"error receiving Ethernet packet on ens3: Permission denied".

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
---
 lib/netdev-linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Feb. 16, 2016, 2:26 a.m. UTC | #1
Hi,

On Mon, Feb 15, 2016 at 03:14:21PM -0200, Thadeu Lima de Souza Cascardo wrote:
> Instead of reading
> 
> "error receiving Ethernet packet on Permission denied: ens3",
> 
> it should read
> 
> "error receiving Ethernet packet on ens3: Permission denied".

It seems to me that the aim of this patch is to make the error message
format consistent with something else. But I think that if you wish to do
that you should make all other messages that make use of netdev names or
strerror, at least within the same source file, consistent.

> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
> ---
>  lib/netdev-linux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> index 393b4cc..d58c1b1 100644
> --- a/lib/netdev-linux.c
> +++ b/lib/netdev-linux.c
> @@ -1107,7 +1107,7 @@ netdev_linux_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets,
>      if (retval) {
>          if (retval != EAGAIN && retval != EMSGSIZE) {
>              VLOG_WARN_RL(&rl, "error receiving Ethernet packet on %s: %s",
> -                         ovs_strerror(errno), netdev_rxq_get_name(rxq_));
> +                         netdev_rxq_get_name(rxq_), ovs_strerror(errno));
>          }
>          dp_packet_delete(buffer);
>      } else {
> -- 
> 2.5.0
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
Thadeu Lima de Souza Cascardo Feb. 16, 2016, 11:35 a.m. UTC | #2
On Tue, Feb 16, 2016 at 11:26:11AM +0900, Simon Horman wrote:
> Hi,
> 
> On Mon, Feb 15, 2016 at 03:14:21PM -0200, Thadeu Lima de Souza Cascardo wrote:
> > Instead of reading
> > 
> > "error receiving Ethernet packet on Permission denied: ens3",
> > 
> > it should read
> > 
> > "error receiving Ethernet packet on ens3: Permission denied".
> 
> It seems to me that the aim of this patch is to make the error message
> format consistent with something else. But I think that if you wish to do

No, not really. It simply doesn't make sense to say you received a packet on an
error message. You received a packet on an interface. I noticed the error by
itself, when running vswitchd on netdev mode with SELinux on enforcing mode,
without all the necessary permissions.

> that you should make all other messages that make use of netdev names or
> strerror, at least within the same source file, consistent.

It's not about consistency, but I agree if there are any other messages like
this, that they should be fixed as well.

Cascardo.

> 
> > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
> > ---
> >  lib/netdev-linux.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> > index 393b4cc..d58c1b1 100644
> > --- a/lib/netdev-linux.c
> > +++ b/lib/netdev-linux.c
> > @@ -1107,7 +1107,7 @@ netdev_linux_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets,
> >      if (retval) {
> >          if (retval != EAGAIN && retval != EMSGSIZE) {
> >              VLOG_WARN_RL(&rl, "error receiving Ethernet packet on %s: %s",
> > -                         ovs_strerror(errno), netdev_rxq_get_name(rxq_));
> > +                         netdev_rxq_get_name(rxq_), ovs_strerror(errno));
> >          }
> >          dp_packet_delete(buffer);
> >      } else {
> > -- 
> > 2.5.0
> > 
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev
Ben Pfaff Feb. 16, 2016, 5:35 p.m. UTC | #3
On Mon, Feb 15, 2016 at 03:14:21PM -0200, Thadeu Lima de Souza Cascardo wrote:
> Instead of reading
> 
> "error receiving Ethernet packet on Permission denied: ens3",
> 
> it should read
> 
> "error receiving Ethernet packet on ens3: Permission denied".
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>

Thanks, I applied this to master and backported as far as branch-2.3.
diff mbox

Patch

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 393b4cc..d58c1b1 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -1107,7 +1107,7 @@  netdev_linux_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets,
     if (retval) {
         if (retval != EAGAIN && retval != EMSGSIZE) {
             VLOG_WARN_RL(&rl, "error receiving Ethernet packet on %s: %s",
-                         ovs_strerror(errno), netdev_rxq_get_name(rxq_));
+                         netdev_rxq_get_name(rxq_), ovs_strerror(errno));
         }
         dp_packet_delete(buffer);
     } else {