From 8795d4fd6e6a5cd1b0f12b63dd91b466b83c87f3 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Mon, 21 May 2012 15:36:37 -0400 Subject: [PATCH] relay: use IETF IP testing addresses --- config.sample/norelayclients | 8 ++++---- config.sample/relayclients | 2 +- t/plugin_tests/relay | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config.sample/norelayclients b/config.sample/norelayclients index 0ad5e1a..5fab985 100644 --- a/config.sample/norelayclients +++ b/config.sample/norelayclients @@ -1,5 +1,5 @@ -# sample entries, used for testing -192.168.99.5 -192.168.99.6 -192.168.98. +# test entries - http://tools.ietf.org/html/rfc5737 +192.0.99.5 +192.0.99.6 +192.0.98. # add your own entries below... diff --git a/config.sample/relayclients b/config.sample/relayclients index 5bbb91d..13c9be7 100644 --- a/config.sample/relayclients +++ b/config.sample/relayclients @@ -2,4 +2,4 @@ # e.g. "127.0.0.1", or "192.168." 127.0.0.1 # leading/trailing whitespace is ignored - 192.168. + 192.0. diff --git a/t/plugin_tests/relay b/t/plugin_tests/relay index 3d1b91e..988c184 100644 --- a/t/plugin_tests/relay +++ b/t/plugin_tests/relay @@ -33,24 +33,24 @@ sub test_is_octet_match { $self->populate_relayclients(); - $self->qp->connection->remote_ip('192.168.1.1'); + $self->qp->connection->remote_ip('192.0.1.1'); ok( $self->is_octet_match(), "match, +"); - $self->qp->connection->remote_ip('192.169.1.1'); + $self->qp->connection->remote_ip('192.51.1.1'); ok( ! $self->is_octet_match(), "nope, -"); - $self->qp->connection->remote_ip('10.10.10.10'); + $self->qp->connection->remote_ip('203.0.113.0'); ok( ! $self->is_octet_match(), "nope, -"); }; sub test_is_in_cidr_block { my $self = shift; - $self->qp->connection->remote_ip('192.168.1.1'); - $self->{_cidr_blocks} = [ '192.168.1.0/24' ]; + $self->qp->connection->remote_ip('192.0.1.1'); + $self->{_cidr_blocks} = [ '192.0.1.0/24' ]; ok( $self->is_in_cidr_block(), "match, +" ); - $self->{_cidr_blocks} = [ '192.168.0.0/24' ]; + $self->{_cidr_blocks} = [ '192.0.0.0/24' ]; ok( ! $self->is_in_cidr_block(), "nope, -" ); @@ -65,8 +65,8 @@ sub test_is_in_cidr_block { sub test_is_in_norelayclients { my $self = shift; - my @matches = qw/ 192.168.99.5 192.168.98.1 192.168.98.255 /; - my @false = qw/ 192.168.99.7 192.168.109.7 /; + my @matches = qw/ 192.0.99.5 192.0.98.1 192.0.98.255 /; + my @false = qw/ 192.0.99.7 192.0.109.7 /; foreach ( @matches ) { $self->qp->connection->remote_ip($_);