[network-manager-applet/nma-1-0] connection-editor: fix InfiniBand hwaddr validation (rh #1182560)
- From: Dan Williams <dcbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/nma-1-0] connection-editor: fix InfiniBand hwaddr validation (rh #1182560)
- Date: Wed, 21 Jan 2015 22:53:44 +0000 (UTC)
commit c187dec658e6f24ef3ae3933cfd1c7e1634c6e74
Author: Dan Winship <danw redhat com>
Date: Thu Jan 15 08:52:36 2015 -0500
connection-editor: fix InfiniBand hwaddr validation (rh #1182560)
Fix the InfiniBand hardware address validation code; it was requiring
the field to contain only a hardware address, but the pre-filled-in
combobox entries include the interface name too. Copy over the code
from page-ethernet.c, which was doing the right thing.
(cherry picked from commit 7509976afe4e37361f4c872d58f5e44c28de20db)
src/connection-editor/page-infiniband.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/connection-editor/page-infiniband.c b/src/connection-editor/page-infiniband.c
index 937da39..f85e453 100644
--- a/src/connection-editor/page-infiniband.c
+++ b/src/connection-editor/page-infiniband.c
@@ -211,14 +211,18 @@ validate (CEPage *page, NMConnection *connection, GError **error)
{
CEPageInfiniband *self = CE_PAGE_INFINIBAND (page);
CEPageInfinibandPrivate *priv = CE_PAGE_INFINIBAND_GET_PRIVATE (self);
+ gboolean invalid = FALSE;
+ GByteArray *ignore;
GtkWidget *entry;
- char buf[INFINIBAND_ALEN];
- const char *hwaddr;
entry = gtk_bin_get_child (GTK_BIN (priv->device_mac));
- hwaddr = gtk_entry_get_text (GTK_ENTRY (entry));
- if (hwaddr && *hwaddr && !nm_utils_hwaddr_aton (hwaddr, ARPHRD_INFINIBAND, buf))
- return FALSE;
+ if (entry) {
+ ignore = ce_page_entry_to_mac (GTK_ENTRY (entry), ARPHRD_INFINIBAND, &invalid);
+ if (invalid)
+ return FALSE;
+ if (ignore)
+ g_byte_array_free (ignore, TRUE);
+ }
ui_to_setting (self);
return nm_setting_verify (NM_SETTING (priv->setting), NULL, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]