File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,10 @@ pub fn ip(name: &str, net: IpNetwork) -> Result<IpAddr> {
5353 return Err ( Error :: PrefixTooBig ( net) ) ;
5454 }
5555 let prefix = IP6_PREFIX - IP4_PREFIX + net4. prefix ( ) ;
56- let net6 = format ! ( "::{}/{prefix}" , net4. ip( ) ) . parse :: < Ipv6Network > ( ) ?;
56+ let net6 = format ! ( "::ffff: {}/{prefix}" , net4. ip( ) ) . parse :: < Ipv6Network > ( ) ?;
5757 let ipv6_addr = ip6 ( name, net6) ?. to_string ( ) ;
5858 let ip_addr = ipv6_addr
59- . strip_prefix ( "::" )
59+ . strip_prefix ( "::ffff: " )
6060 // This error should never happen but I'm not a fan of panicking in libraries
6161 . ok_or_else ( || Error :: InvalidIpNetwork ( format ! ( "[BUG] the generated IPv6 address `{ipv6_addr}` does not start with the expected prefix `::`" ) ) ) ?
6262 . parse ( )
You can’t perform that action at this time.
0 commit comments