Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 704940 Details for
Bug 475302
netifrc - /lib64/rc/net/ip6rd.sh has two problems
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ip6rd fixes
ip6rd.sh.diff (text/plain), 1.63 KB, created by
Fredrik Eriksson
on 2021-05-01 09:50:18 UTC
(
hide
)
Description:
ip6rd fixes
Filename:
MIME Type:
Creator:
Fredrik Eriksson
Created:
2021-05-01 09:50:18 UTC
Size:
1.63 KB
patch
obsolete
>--- ip6rd.sh.orig 2021-05-01 10:02:07.979716992 +0200 >+++ ip6rd.sh 2021-05-01 11:27:15.194443097 +0200 >@@ -7,6 +7,7 @@ > ip6rd_depend() > { > program ip >+ program ipv6calc > after interface > } > >@@ -58,17 +59,17 @@ > fi > for addr in ${addrs}; do > # Strip the subnet >- local ip="${addr%/*}" subnet="${addr#*/}" >+ local ip="${addr%/*}" subnet="$(_ip6rd_inet_get_network ${addr%/*} ${ipv4mask})" > # We don't work on private IPv4 addresses > if _ip6rd_inet_is_private_network "${ip}" > then > continue > fi > >- local ip6= ip6_prefix="${prefix%::/*}" ip6_subnet="${prefix#*/}" >- ip6_subnet=$((ip6_subnet + (32-ipv4mask))) >- eval ip6="$(printf "${ip6_prefix}:%s::%s" \ >- $(_ip6rd_prefix_shave_bits ${ip} ${ipv4mask}) ${suffix})" >+ local ip6 ip6_subnet >+ ip6=$(ipv6calc --in ipv4addr --out ipv6addr --action 6rd_local_prefix --6rd_prefix "${prefix}" --6rd_relay_prefix "${subnet}/${ipv4mask}" "${ip}") >+ ip6_subnet=${ip6#*/} >+ ip6=${ip6%/*} > veinfo "Derived IPv6 address: ${ip6}" > > # Now apply our IPv6 address to our config >@@ -90,7 +91,7 @@ > if [ "${IFACE}" != "sit0" ]; then > _tunnel add "${IFACE}" mode sit ttl 255 remote any local "${localip}" > fi >- _tunnel 6rd dev "${IFACE}" 6rd-prefix "${prefix}" >+ _tunnel 6rd dev "${IFACE}" 6rd-prefix "${prefix}" 6rd-relay_prefix "${subnet}/${ipv4mask}" > eend $? || return 1 > _up > >@@ -143,9 +144,8 @@ > _ip6rd_inet_get_network() > { > local a=$(_ip6rd_inet_atoi $1) >- local net=$(( a & ( (1<<$2)-1 ) )) >- local cidr=$(( 32 - $2 )) >- echo $(_ip6rd_inet_itoa $(( (net << cidr ) )) ) >+ local net=$(( a & ( 0xffffffff << (32 - $2)) )) >+ echo $(_ip6rd_inet_itoa $net) > } > > _ip6rd_inet_is_private_network()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 475302
:
704940
|
705069