Send Netdot-devel mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-devel
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-devel digest..."


Today's Topics:

   1. [Netdot - Bug #1740] (New) Not possible to give an        existing
      ipv4 host an ipv6 address via user_management (and        vice versa)
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Sat, 23 Mar 2013 06:49:14 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1740] (New) Not possible to
        give an existing ipv4 host an ipv6 address via user_management (and
        vice versa)
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1740 has been reported by Wim Vandersmissen.

----------------------------------------
Bug #1740: Not possible to give an existing ipv4 host an ipv6 address via 
user_management (and vice versa)
https://osl.uoregon.edu/redmine/issues/1740

Author: Wim Vandersmissen
Status: New
Priority: Normal
Assignee: 
Category: 
Target version: 
Resolution: 


When there already exists a hostname in a zone with an IPv4 address (e.g. 
host.mydomain.com IN A 1.2.3.4) it's not possible to add an ipv6 address with 
the same hostname (e.g. host.domain.com IN AAAA 2001:db8::1) via the delegated 
user_management interface (as admin it's possible)
(and vice versa, adding an ipv4 address to a hostname which already has an ipv6 
address)

Simple patch below fixes this for me
<pre>
--- Model/RR.pm 2012-12-05 17:35:01.000000000 +0100
+++ Model/RR.pm 2013-03-20 00:18:35.000000000 +0100
@@ -518,7 +518,26 @@
        unless $zone;

     if ( my $h = RR->search(name=>$argv{name}, zone=>$zone)->first ){
-       $class->throw_user($h->get_label." is already taken");
+       my $arecords=$h->a_records;
+       my $records=$arecords->{_data};
+       my $v4version=0;
+       my $v6version=0;
+       #print Dumper(@records);
+       foreach my $record (@{$records}) {
+               my @ipblocks=Ipblock->search(id=>$record->{ipblock});
+               foreach my $ipblock (@ipblocks) {
+                       if ($ipblock->version == 4) {
+                               $v4version=1;
+                       }
+                       if ($ipblock->version == 6) {
+                               $v6version=1;
+                       }
+               }
+       }
+
+       if ($v4version && $v6version) {
+               $class->throw_user($h->get_label." is already taken");
+       }
     }

</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel


End of Netdot-devel Digest, Vol 72, Issue 6
*******************************************

Reply via email to