From c6b6501baad7853eab4109df1fde398a7303cc13 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Wed, 2 Apr 2008 18:58:18 +0000 Subject: [PATCH] Add support to be able to configure the peer too. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2709 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- doc/configuration.xml | 5 +++++ scripts/vserver.functions | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/configuration.xml b/doc/configuration.xml index 9ce06f0..16e3224 100644 --- a/doc/configuration.xml +++ b/doc/configuration.xml @@ -1382,6 +1382,11 @@ not a group name. Sets the link type of tun/tap interfaces. + + +Sets the peer for a point-to-point link, such as a tun interface. + + diff --git a/scripts/vserver.functions b/scripts/vserver.functions index c97c0c6..26edb7b 100644 --- a/scripts/vserver.functions +++ b/scripts/vserver.functions @@ -561,6 +561,7 @@ function _processSingleInterface local mac local extip local up="up" + local peer _getInterfaceValue ip '' "$iface" _getInterfaceValue extip '' "$iface" "$iface/.." @@ -571,6 +572,7 @@ function _processSingleInterface _getInterfaceValue name '' "$iface" _getInterfaceValue scope '' "$iface" "$iface/.." _getInterfaceValue mac '' "$iface" + _getInterfaceValue peer '' "$iface" test -n "$ip" || { echo $"Can not read ip for '$iface'" >&2; return 1; } test -n "$dev" -o -e "$iface"/nodev || { @@ -613,7 +615,7 @@ function _processSingleInterface _addInterfaceCmd TUNCTL "$dev" $tun_info fi - _addInterfaceCmd IP_ADDR "$ip${prefix:+/$prefix}" $use_bcast ${name:+label "$dev:$name"} dev "$dev" + _addInterfaceCmd IP_ADDR "$ip${prefix:+/$prefix}" $use_bcast ${name:+label "$dev:$name"} dev "$dev" ${peer:+peer "$peer"} #_addInterfaceCmd IP_ROUTE "$ip${prefix:+/$prefix}" dev "$dev" _addInterfaceCmd IP_LINK "$dev" $up elif ! test -n "$N_CONTEXT"; then -- 1.8.1.5