lib/spf/model.rb in spf-0.0.7 vs lib/spf/model.rb in spf-0.0.8

- old
+ new

@@ -164,12 +164,12 @@ if @parse_text.sub!(/^\/(\d+)/, '') bits = $1.to_i unless bits and bits >= 0 and bits <= 128 and $1 !~ /^0./ raise SPF::TermIPv6PrefixLengthExpectedError.new( "Invalid IPv6 prefix length encountered in '#{@text}'") - @ipv6_prefix_length = bits end + @ipv6_prefix_length = bits elsif required raise SPF::TermIPvPrefixLengthExpected.new( "Missing required IPv6 prefix length in '#{@text}'") else @ipv6_prefix_length = self.default_ipv6_prefix_length @@ -177,11 +177,9 @@ end def parse_ipv6_network(required = false) self.parse_ipv6_address(required) self.parse_ipv6_prefix_length - # XXX we shouldn't need to check for this. - @ipv6_prefix_length = self.default_ipv6_prefix_length unless @ipv6_prefix_length @ip_network = IP.new("#{@ip_address}/#{@ipv6_prefix_length}") end def parse_ipv4_ipv6_prefix_lengths self.parse_ipv4_prefix_length