[Mageia-sysadm] [168] - patch from Maarten Vanraes to fix the issue of keyprefix with ipv6

Michael Scherer misc at zarb.org
Wed Dec 15 02:25:21 CET 2010


Le mardi 14 décembre 2010 à 20:27 +0100, Maarten Vanraes a écrit :
> Op dinsdag 14 december 2010 00:15:44 schreef root at mageia.org:
> > Revision: 168
> > Author:   misc
> > Date:     2010-12-14 00:15:43 +0100 (Tue, 14 Dec 2010)
> > Log Message:
> > -----------
> > - patch from Maarten Vanraes to fix the issue of keyprefix with ipv6
> > 
> > Modified Paths:
> > --------------
> >     identity/CatDap/trunk/lib/CatDap/Controller/user.pm
> > 
> > Modified: identity/CatDap/trunk/lib/CatDap/Controller/user.pm
> > ===================================================================
> > --- identity/CatDap/trunk/lib/CatDap/Controller/user.pm	2010-12-13 23:12:16
> > UTC (rev 167) +++
> > identity/CatDap/trunk/lib/CatDap/Controller/user.pm	2010-12-13 23:15:43
> > UTC (rev 168) @@ -114,8 +114,20 @@
> > 
> >  sub get_keyprefix : Private {
> >      my ( $self, $c ) = @_;
> > -    return sprintf("%02x%02x%02x",split /\./,$c->req->address);
> > +    my $keyprefix;
> > +    if ($c->req->address =~ m/:/) {
> > +        my $address = $c->req->address;
> > +        $address =~ s/\[\]://;
> > +
> > +        # if we shift right 104 bits from 128 we have 24 bits left or 3
> > bytes. +        $keyprefix = sprintf( "%06x", $address >> 104 );
> > +    }
> > +    else {
> > +        $keyprefix = sprintf( "%02x%02x%02x", split /\./, $c->req->address
> > ); +    }
> > +    return $keyprefix;
> >  }
> > +
> >  =head2 index
> > 
> >  =cut
> 
> 
> there is still a similar patch for  
> identity/CatDap/trunk/lib/CatDap/Controller/admin.pm

the function is duplicated ?

-- 
Michael Scherer



More information about the Mageia-sysadm mailing list