- Set username to descr during interface is in use.
- Make dtcpc_fib work.
This commit is contained in:
parent
a6cc458d9b
commit
32b02e6a47
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=355644
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
PORTNAME= dtcp
|
PORTNAME= dtcp
|
||||||
PORTVERSION= 20130602
|
PORTVERSION= 20130602
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= net ipv6
|
CATEGORIES= net ipv6
|
||||||
MASTER_SITES= http://www.mahoroba.org/~ume/ipv6/ \
|
MASTER_SITES= http://www.mahoroba.org/~ume/ipv6/ \
|
||||||
http://home.jp.FreeBSD.org/~ume/ipv6/
|
http://home.jp.FreeBSD.org/~ume/ipv6/
|
||||||
|
@ -32,4 +32,7 @@ extra_commands="reload"
|
|||||||
|
|
||||||
load_rc_config $name
|
load_rc_config $name
|
||||||
command_args="-u ${dtcpc_username} ${dtcpc_server}"
|
command_args="-u ${dtcpc_username} ${dtcpc_server}"
|
||||||
|
if [ -n "${dtcpc_fib}" ]; then
|
||||||
|
command_args="-F ${dtcpc_fib} ${command_args}"
|
||||||
|
fi
|
||||||
run_rc_command "$1"
|
run_rc_command "$1"
|
||||||
|
70
net/dtcp/files/patch-dtcpc.rb
Normal file
70
net/dtcp/files/patch-dtcpc.rb
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
Index: dtcpc.rb
|
||||||
|
diff -u dtcpc.rb.orig dtcpc.rb
|
||||||
|
--- dtcpc.rb.orig 2013-06-02 23:05:51.000000000 +0900
|
||||||
|
+++ dtcpc.rb 2014-05-22 17:24:50.852383194 +0900
|
||||||
|
@@ -422,6 +422,10 @@
|
||||||
|
execute("ifconfig #{@name} mtu #{mtu}")
|
||||||
|
end
|
||||||
|
|
||||||
|
+ def setfib(fibnum)
|
||||||
|
+ execute("ifconfig #{@name} fib #{fibnum}")
|
||||||
|
+ end
|
||||||
|
+
|
||||||
|
def linklocal
|
||||||
|
`ifconfig #{@name} inet6`.each_line { |s|
|
||||||
|
if s =~ /inet6 (fe80::[^ ]*)/
|
||||||
|
@@ -461,6 +465,9 @@
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
+ if $fibnum >= 0
|
||||||
|
+ setfib($fibnum)
|
||||||
|
+ end
|
||||||
|
@created = true
|
||||||
|
end
|
||||||
|
|
||||||
|
@@ -520,6 +527,9 @@
|
||||||
|
if !@tunif || @tunif == "ng"
|
||||||
|
@name = mkpeer
|
||||||
|
@created = true
|
||||||
|
+ if $fibnum >= 0
|
||||||
|
+ setfib($fibnum)
|
||||||
|
+ end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
@@ -535,6 +545,9 @@
|
||||||
|
@name = mkpeer
|
||||||
|
if @name == @tunif
|
||||||
|
@created = true
|
||||||
|
+ if $fibnum >= 0
|
||||||
|
+ setfib($fibnum)
|
||||||
|
+ end
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
|
@@ -927,6 +940,7 @@
|
||||||
|
password = ''
|
||||||
|
tunif = TUNIF
|
||||||
|
cloning = TUNIF_CLONING
|
||||||
|
+$fibnum = -1
|
||||||
|
tuntype = 'tunnelonly'
|
||||||
|
route_type = 'static'
|
||||||
|
static_routes = 'default'
|
||||||
|
@@ -949,7 +963,7 @@
|
||||||
|
# exit 0
|
||||||
|
|
||||||
|
begin
|
||||||
|
- params = ARGV.getopts('aA:b:cdDf:i:lm:nop:P:r:R:t:u:U')
|
||||||
|
+ params = ARGV.getopts('aA:b:cdDfF:i:lm:nop:P:r:R:t:u:U')
|
||||||
|
rescue
|
||||||
|
usage()
|
||||||
|
exit 0
|
||||||
|
@@ -965,6 +979,7 @@
|
||||||
|
$debug = params["d"]
|
||||||
|
daemonize = params["D"]
|
||||||
|
pidfile = params["f"] if params["f"]
|
||||||
|
+$fibnum = params["F"].to_i if params["F"]
|
||||||
|
tunif = params["i"] if params["i"]
|
||||||
|
loop = params["l"]
|
||||||
|
mtu = params["m"].to_i if params["m"]
|
@ -1,19 +1,27 @@
|
|||||||
Index: dtcps.rb
|
Index: dtcps.rb
|
||||||
diff -u dtcps.rb.orig dtcps.rb
|
diff -u dtcps.rb.orig dtcps.rb
|
||||||
--- dtcps.rb.orig 2013-06-02 23:05:51.000000000 +0900
|
--- dtcps.rb.orig 2013-06-02 23:05:51.000000000 +0900
|
||||||
+++ dtcps.rb 2014-05-19 01:24:45.817292755 +0900
|
+++ dtcps.rb 2014-05-22 17:24:50.868385076 +0900
|
||||||
@@ -185,6 +185,10 @@
|
@@ -185,6 +185,18 @@
|
||||||
execute("ifconfig #{@name} mtu #{mtu}")
|
execute("ifconfig #{@name} mtu #{mtu}")
|
||||||
end
|
end
|
||||||
|
|
||||||
+ def setfib(fibnum)
|
+ def setfib(fibnum)
|
||||||
+ execute("ifconfig #{@name} fib #{fibnum}")
|
+ execute("ifconfig #{@name} fib #{fibnum}")
|
||||||
+ end
|
+ end
|
||||||
|
+
|
||||||
|
+ def setdescr(str = nil)
|
||||||
|
+ if str == nil
|
||||||
|
+ execute("ifconfig #{@name} -description >/dev/null 2>&1")
|
||||||
|
+ else
|
||||||
|
+ execute("ifconfig #{@name} description #{str} >/dev/null 2>&1")
|
||||||
|
+ end
|
||||||
|
+ end
|
||||||
+
|
+
|
||||||
def linklocal
|
def linklocal
|
||||||
`ifconfig #{@name} inet6`.each_line { |s|
|
`ifconfig #{@name} inet6`.each_line { |s|
|
||||||
if s =~ /inet6 (fe80::[^ ]*)/
|
if s =~ /inet6 (fe80::[^ ]*)/
|
||||||
@@ -226,6 +230,9 @@
|
@@ -226,6 +238,9 @@
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -23,7 +31,7 @@ diff -u dtcps.rb.orig dtcps.rb
|
|||||||
@created = true
|
@created = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -291,6 +298,9 @@
|
@@ -291,6 +306,9 @@
|
||||||
if !@tunif || @tunif == "ng"
|
if !@tunif || @tunif == "ng"
|
||||||
@name = mkpeer
|
@name = mkpeer
|
||||||
@created = true
|
@created = true
|
||||||
@ -33,7 +41,7 @@ diff -u dtcps.rb.orig dtcps.rb
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -306,6 +316,9 @@
|
@@ -306,6 +324,9 @@
|
||||||
@name = mkpeer
|
@name = mkpeer
|
||||||
if @name == @tunif
|
if @name == @tunif
|
||||||
@created = true
|
@created = true
|
||||||
@ -43,7 +51,23 @@ diff -u dtcps.rb.orig dtcps.rb
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1173,13 +1186,14 @@
|
@@ -724,6 +745,7 @@
|
||||||
|
}
|
||||||
|
delpeer(@tunif, @info[3], @info[2])
|
||||||
|
end
|
||||||
|
+ tunif.setdescr
|
||||||
|
_delete(@tunif)
|
||||||
|
@tunif = nil
|
||||||
|
end
|
||||||
|
@@ -769,6 +791,7 @@
|
||||||
|
raise 'tunnel interface sold out'
|
||||||
|
end
|
||||||
|
debugmsg("#{s}: tunnel interface #{tunif.name}\n")
|
||||||
|
+ tunif.setdescr(user)
|
||||||
|
|
||||||
|
myaddr = nil
|
||||||
|
if type == 'host' || (type == 'network' && $network_with_peeraddr)
|
||||||
|
@@ -1173,13 +1196,14 @@
|
||||||
$tunif = TUNIF
|
$tunif = TUNIF
|
||||||
$ng_tunif = "ng"
|
$ng_tunif = "ng"
|
||||||
$cloning = TUNIF_CLONING
|
$cloning = TUNIF_CLONING
|
||||||
@ -59,7 +83,7 @@ diff -u dtcps.rb.orig dtcps.rb
|
|||||||
rescue
|
rescue
|
||||||
usage()
|
usage()
|
||||||
exit 0
|
exit 0
|
||||||
@@ -1190,6 +1204,7 @@
|
@@ -1190,6 +1214,7 @@
|
||||||
$cloning = false if params["c"]
|
$cloning = false if params["c"]
|
||||||
$debug = params["d"]
|
$debug = params["d"]
|
||||||
$daemonize = !params["D"]
|
$daemonize = !params["D"]
|
||||||
|
Loading…
Reference in New Issue
Block a user