Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 632673 Details for
Bug 862463
RFE: ovs-vsctl: report ovs-vswitchd warnings and errors resulting directly from a ovs-vsctl command
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch
ovs-check-valid.diff (text/plain), 2.04 KB, created by
Cong Wang
on 2012-10-24 09:49:14 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Cong Wang
Created:
2012-10-24 09:49:14 UTC
Size:
2.04 KB
patch
obsolete
>Subject: [PATCH] ovs-vsctl: check if the device name is valid > >Before waiting for the kernel to reject an invalid name, we >can actually check it before going into the kernel. The code >is stolen from linux kernel function dev_valid_name(), >but it should apply to non-Linux arch as well, because >IFNAMSIZ is POSIX and other errors are obvious. > >After this patch I got: > ># ovs-vsctl add-port ovsbr0 12345678901234567890 >ovs-vsctl: cannot create a port named 12345678901234567890 because the name is not valid ># ovs-vsctl add-br 12345678901234567890 >ovs-vsctl: cannot create a bridge named 12345678901234567890 because the name is not valid > >Cc: Ben Pfaff <blp@nicira.com> >Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> > >--- >diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c >index fda3a89..3015f8c 100644 >--- a/utilities/ovs-vsctl.c >+++ b/utilities/ovs-vsctl.c >@@ -27,6 +27,7 @@ > #include <stdlib.h> > #include <string.h> > #include <unistd.h> >+#include <net/if.h> > > #include "command-line.h" > #include "compiler.h" >@@ -992,6 +993,28 @@ vsctl_context_populate_cache(struct vsctl_context *ctx) > sset_destroy(&bridges); > } > >+/* Stolen from Linux kernel net/core/dev.c::dev_valid_name() >+ * Catch the most obvious errors and enforce the POSIX limit IFNAMSIZ >+ */ >+static int >+is_valid_name(const char *name) >+{ >+ if (*name == '\0') >+ return 0; >+ if (strlen(name) >= IFNAMSIZ) >+ return 0; >+ if (!strcmp(name, ".") || !strcmp(name, "..")) >+ return 0; >+ >+ while (*name) { >+ if (*name == '/' || isspace(*name)) >+ return 0; >+ name++; >+ } >+ >+ return 1; >+} >+ > static void > check_conflicts(struct vsctl_context *ctx, const char *name, > char *msg) >@@ -1001,6 +1024,10 @@ check_conflicts(struct vsctl_context *ctx, const char *name, > > verify_ports(ctx); > >+ if (!is_valid_name(name)) { >+ vsctl_fatal("%s because the name is not valid", msg); >+ } >+ > if (shash_find(&ctx->bridges, name)) { > vsctl_fatal("%s because a bridge named %s already exists", > msg, name);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 862463
: 632673