[Rtir] Wondering if this is the best way to stop RTIR from detecting CIDR ranges
Kevin Falcone
falcone at bestpractical.com
Tue May 28 16:49:58 EDT 2013
On Fri, May 24, 2013 at 02:11:58PM -0700, Landon wrote:
> I'm wondering if this is the best way to stop RTIR from detecting CIDR ranges. I've been
> looking into /opt/rt4/local/plugins/RT-IR/lib/RT/Action/RTIR_FindIP.pm and modified the
> following section:
> elsif ( $4 && defined $5 ) { # IPv4/mask
> next; # Do not add IPv4 ranges to tickets
> my $cidr = join( '.', map $_||0, (split /\./, $4)[0..3] ) ."/$5";
> my $range = (Net::CIDR::cidr2range( $cidr ))[0] or next;
> $spots_left -= $self->AddIP(
> IP => $range, CustomField => $cf, Skip => \%existing
> );
> }
> Is this the best way? Or is there something else I should have done instead?
It's almost impossible for me to parse your changes since the
whitespace has been completely lost.
Can you instead post a unified diff (diff -u) of your change?
Also, if you're going to change RT/extension code, you should be using
local/lib instead of hacking in place. Otherwise upgrading will be...
fun.
-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 235 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rtir/attachments/20130528/06017de4/attachment.pgp>
More information about the Rtir
mailing list