Thursday, July 7, 2016

[389-commits] src/com

src/com/netscape/admin/dirserv/panel/replication/HostInfoDialog.java | 39 ++++++++--
1 file changed, 33 insertions(+), 6 deletions(-)

New commits:
commit 2163fdb2775b6c04532a06fca08a4212d8ff277b
Author: Mark Reynolds <mreynolds@redhat.com>
Date: Wed Jul 6 10:04:32 2016 -0400

Ticket 48823 - ds-console - add IPv6 support

Description: In the replication agreement wizard allow the characters
needed for IPv6 addresses according to RFC 2732.

Also, if the IPv6 address is not enclosed in brackets
then add the brackets (this is really needed by ldapjdk).

https://fedorahosted.org/389/ticket/48823

Reviewed by: nhosoi(Thanks!)

diff --git a/src/com/netscape/admin/dirserv/panel/replication/HostInfoDialog.java b/src/com/netscape/admin/dirserv/panel/replication/HostInfoDialog.java
index 48ed18e..6839004 100644
--- a/src/com/netscape/admin/dirserv/panel/replication/HostInfoDialog.java
+++ b/src/com/netscape/admin/dirserv/panel/replication/HostInfoDialog.java
@@ -19,13 +19,31 @@

package com.netscape.admin.dirserv.panel.replication;

-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.*;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseMotionListener;
+
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+
import com.netscape.admin.dirserv.DSUtil;
import com.netscape.admin.dirserv.panel.UIFactory;
-import com.netscape.management.client.util.*;
+import com.netscape.management.client.util.AbstractDialog;
+import com.netscape.management.client.util.Debug;
+import com.netscape.management.client.util.ResourceSet;


/**
@@ -174,10 +192,11 @@ class HostInfoDialog extends AbstractDialog
for (int i = 0; host_ok && (i < host.length()); i++) {
if ( (Character.UnicodeBlock.of(host.charAt(i)) != Character.UnicodeBlock.BASIC_LATIN) ||
( (!Character.isLetterOrDigit(host.charAt(i))) && (host.charAt(i) != '.') &&
+ (host.charAt(i) != ':') && (host.charAt(i) != '[') && (host.charAt(i) != ']') &&
(host.charAt(i) != '-') ) ) {
host_ok = false;
}
- }
+ }

try {
int value = Integer.parseInt(_portText.getText());
@@ -239,6 +258,14 @@ class HostInfoDialog extends AbstractDialog
} catch(NumberFormatException ex) {
return;
}
+
+ if (!_fqHostName.startsWith("[") && _fqHostName.contains(":")){
+ // Looks like an IPv6 address without brackets... add them
+ StringBuilder sb = new StringBuilder("[");
+ sb.append(_fqHostName);
+ sb.append("]");
+ _fqHostName = sb.toString();
+ }
_isOk = true;
setVisible(false);
dispose();

--
389-commits mailing list
389-commits@lists.fedoraproject.org
https://lists.fedoraproject.org/admin/lists/389-commits@lists.fedoraproject.org

No comments:

Post a Comment