Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 82842 Details for
Bug 127149
rfc3442 support in udhcp client
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
baselayout-rfc3442-udhcp.patch
baselayout-rfc3442-udhcp.patch (text/plain), 2.14 KB, created by
Alexander Zubkov
on 2006-03-21 23:06:57 UTC
(
hide
)
Description:
baselayout-rfc3442-udhcp.patch
Filename:
MIME Type:
Creator:
Alexander Zubkov
Created:
2006-03-21 23:06:57 UTC
Size:
2.14 KB
patch
obsolete
>--- rc-scripts-1.6.14.orig/lib/rcscripts/net.modules.d/helpers.d/udhcpc-iproute2 2006-03-21 17:40:09.528606500 +0300 >+++ rc-scripts-1.6.14/lib/rcscripts/net.modules.d/helpers.d/udhcpc-iproute2 2006-03-21 18:31:19.872491000 +0300 >@@ -62,14 +62,50 @@ > eval dhcp=\" \$\{dhcp_${interface}\} \" > if [[ ${dhcp} != *' nogateway '* ]]; then > # Configure our default route >- x=$(ip route show | awk '{ if ($1 == "default") {print $3} }') > for r in ${router}; do > # We can only have one default route! >- if [[ -z ${x} ]]; then >- ip route add default via ${r} dev ${interface} 2>/dev/null && break >- elif [[ ${x} != ${r} ]]; then >- ip route change default via ${r} dev ${interface} 2>/dev/null && break >- fi >+ ip route replace default via ${r} dev ${interface} 2>/dev/null && break >+ done >+fi >+ >+# Configure static routes >+if [[ "${cidrroute}" ]]; then >+ cidrroute="${cidrroute} " >+ # Work while cidrroute not empty >+ while true; do >+ # First go number of bits in mask >+ bits=${cidrroute%% *} >+ [[ -z ${bits} ]] && break >+ cidrroute=${cidrroute#* } >+ pref="" >+ if [[ ${bits} == 0 ]]; then >+ # We got 0/0 here >+ pref="default" >+ else >+ # Calc how many bytes we need to get from cidrroute >+ # And get them in prefix >+ bytes=$(( (${bits} - 1) / 8 + 1 )) >+ while [[ ${bytes} > 0 ]]; do >+ byte=${cidrroute%% *} >+ cidrroute=${cidrroute#* } >+ pref="${pref}.${byte}" >+ bytes=$(( ${bytes} - 1 )) >+ done >+ pref=${pref#.} >+ pref="${pref}/${bits}" >+ fi >+ # We have subnet prefix now and need to get gateway same way >+ bytes=4 >+ gw="" >+ while [[ ${bytes} > 0 ]]; do >+ byte=${cidrroute%% *} >+ cidrroute=${cidrroute#* } >+ gw="${gw}.${byte}" >+ bytes=$(( ${bytes} - 1 )) >+ done >+ gw=${gw#.} >+ # And add the next route finally >+ ip route replace ${pref} via ${gw} dev ${interface} 2>/dev/null > done > fi >
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 127149
:
82841
| 82842