RT# 83450 - fixed rateplan export
[freeside.git] / FS / FS / IP_Mixin.pm
index beb41d2..8920ceb 100644 (file)
@@ -94,6 +94,10 @@ sub ip_check {
     $self->ip_addr('');
   }
 
+  # Will strip extraneous leading zeros from ip adddresses
+  # e.g. 10.0.022.220 corrected to 10.0.22.220
+  $self->ut_ip46n('ip_addr');
+
   if ( $self->ip_addr
        and !$self->router
        and $self->conf->exists('auto_router') ) {
@@ -130,6 +134,10 @@ sub assign_ip_addr {
   my $self = shift;
   my %opt = @_;
 
+  #otherwise we'll get the same assignment for concurrent identical calls
+  # this will serialize them
+  $_->lock_table foreach @subclasses;
+
   my @blocks;
   my $na = $self->NetAddr;