Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 504106 Details for
Bug 637394
net-misc/netifrc - add support for route types without dev option (iproute2)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
netifrc-iproute2-nodev-types.patch (text/plain), 2.10 KB, created by
Alexander Zubkov
on 2017-11-13 20:04:38 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Alexander Zubkov
Created:
2017-11-13 20:04:38 UTC
Size:
2.10 KB
patch
obsolete
>diff --git a/net/iproute2.sh b/net/iproute2.sh >index 7dea195..a68203c 100644 >--- a/net/iproute2.sh >+++ b/net/iproute2.sh >@@ -204,6 +204,14 @@ _add_address() > return $rc > } > >+_nodev_route_type() >+{ >+ case "$1" in >+ throw|unreachable|prohibit|blackhole) return 0 ;; >+ *) return 1 ;; >+ esac >+} >+ > _add_route() > { > local family= >@@ -219,7 +227,11 @@ _add_route() > shift > fi > >- if [ $# -eq 3 ]; then >+ local nodev=false >+ >+ if _nodev_route_type "$2"; then >+ nodev=true >+ elif [ $# -eq 3 ]; then > set -- "$1" "$2" via "$3" > elif [ "$3" = "gw" ]; then > local one=$1 two=$2 >@@ -233,6 +245,7 @@ _add_route() > metric) metric=$2 ; cmd="${cmd} metric $2" ; shift ; have_metric=true ;; > netmask) x="/$(_netmask2cidr "$2")" ; cmd="${cmd}${x}" ; cmd_nometric="${cmd}${x}" ; shift;; > -host|-net);; >+ throw|unreachable|prohibit|blackhole) cmd="${cmd} ${1}" ;; > *) cmd="${cmd} ${1}" ; cmd_nometric="${cmd_nometric} ${1}" ;; > esac > shift >@@ -247,13 +260,21 @@ _add_route() > fi > > # Check for route already existing: >- ip ${family} route show ${cmd_nometric} dev "${IFACE}" 2>/dev/null | \ >+ ip ${family} route show ${cmd_nometric} 2>/dev/null | \ > fgrep -sq "${cmd%% *}" > route_already_exists=$? > >- veinfo ip ${family} route append ${cmd} dev "${IFACE}" >- ip ${family} route append ${cmd} dev "${IFACE}" >- rc=$? >+ # Some routes are incompatible with dev option >+ if yesno "${nodev}"; then >+ veinfo ip ${family} route append ${cmd} >+ ip ${family} route append ${cmd} >+ rc=$? >+ else >+ veinfo ip ${family} route append ${cmd} dev "${IFACE}" >+ ip ${family} route append ${cmd} dev "${IFACE}" >+ rc=$? >+ fi >+ > # Check return code in some cases > if [ $rc -ne 0 ]; then > # If the route already exists, our default behavior is to WARN but continue. >@@ -268,7 +289,7 @@ _add_route() > *) msgfunc=eerror rc=1 ; eerror "Unknown error behavior: $eh_behavior" ;; > esac > eval $msgfunc "Route '$cmd_nometric' already existed:" >- eval $msgfunc \"$(ip $family route show ${cmd_nometric} dev "${IFACE}" 2>&1)\" >+ eval $msgfunc \"$(ip $family route show ${cmd_nometric} 2>&1)\" > else > : # TODO: Handle other errors > 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 637394
:
504106
|
504454
|
504470
|
504532
|
505050