svn commit: r355644 - in head/net/dtcp: . files
Hajimu UMEMOTO
ume at FreeBSD.org
Wed May 28 17:43:28 UTC 2014
Author: ume
Date: Wed May 28 17:43:27 2014
New Revision: 355644
URL: http://svnweb.freebsd.org/changeset/ports/355644
QAT: https://qat.redports.org/buildarchive/r355644/
Log:
- Set username to descr during interface is in use.
- Make dtcpc_fib work.
Added:
head/net/dtcp/files/patch-dtcpc.rb (contents, props changed)
Modified:
head/net/dtcp/Makefile
head/net/dtcp/files/dtcpc.in
head/net/dtcp/files/patch-dtcps.rb
Modified: head/net/dtcp/Makefile
==============================================================================
--- head/net/dtcp/Makefile Wed May 28 16:47:30 2014 (r355643)
+++ head/net/dtcp/Makefile Wed May 28 17:43:27 2014 (r355644)
@@ -2,7 +2,7 @@
PORTNAME= dtcp
PORTVERSION= 20130602
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net ipv6
MASTER_SITES= http://www.mahoroba.org/~ume/ipv6/ \
http://home.jp.FreeBSD.org/~ume/ipv6/
Modified: head/net/dtcp/files/dtcpc.in
==============================================================================
--- head/net/dtcp/files/dtcpc.in Wed May 28 16:47:30 2014 (r355643)
+++ head/net/dtcp/files/dtcpc.in Wed May 28 17:43:27 2014 (r355644)
@@ -32,4 +32,7 @@ extra_commands="reload"
load_rc_config $name
command_args="-u ${dtcpc_username} ${dtcpc_server}"
+if [ -n "${dtcpc_fib}" ]; then
+ command_args="-F ${dtcpc_fib} ${command_args}"
+fi
run_rc_command "$1"
Added: head/net/dtcp/files/patch-dtcpc.rb
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/dtcp/files/patch-dtcpc.rb Wed May 28 17:43:27 2014 (r355644)
@@ -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"]
Modified: head/net/dtcp/files/patch-dtcps.rb
==============================================================================
--- head/net/dtcp/files/patch-dtcps.rb Wed May 28 16:47:30 2014 (r355643)
+++ head/net/dtcp/files/patch-dtcps.rb Wed May 28 17:43:27 2014 (r355644)
@@ -1,8 +1,8 @@
Index: dtcps.rb
diff -u dtcps.rb.orig dtcps.rb
--- dtcps.rb.orig 2013-06-02 23:05:51.000000000 +0900
-+++ dtcps.rb 2014-05-19 01:24:45.817292755 +0900
-@@ -185,6 +185,10 @@
++++ dtcps.rb 2014-05-22 17:24:50.868385076 +0900
+@@ -185,6 +185,18 @@
execute("ifconfig #{@name} mtu #{mtu}")
end
@@ -10,10 +10,18 @@ diff -u dtcps.rb.orig dtcps.rb
+ execute("ifconfig #{@name} fib #{fibnum}")
+ 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
`ifconfig #{@name} inet6`.each_line { |s|
if s =~ /inet6 (fe80::[^ ]*)/
-@@ -226,6 +230,9 @@
+@@ -226,6 +238,9 @@
end
}
end
@@ -23,7 +31,7 @@ diff -u dtcps.rb.orig dtcps.rb
@created = true
end
-@@ -291,6 +298,9 @@
+@@ -291,6 +306,9 @@
if !@tunif || @tunif == "ng"
@name = mkpeer
@created = true
@@ -33,7 +41,7 @@ diff -u dtcps.rb.orig dtcps.rb
return
end
-@@ -306,6 +316,9 @@
+@@ -306,6 +324,9 @@
@name = mkpeer
if @name == @tunif
@created = true
@@ -43,7 +51,23 @@ diff -u dtcps.rb.orig dtcps.rb
break
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
$ng_tunif = "ng"
$cloning = TUNIF_CLONING
@@ -59,7 +83,7 @@ diff -u dtcps.rb.orig dtcps.rb
rescue
usage()
exit 0
-@@ -1190,6 +1204,7 @@
+@@ -1190,6 +1214,7 @@
$cloning = false if params["c"]
$debug = params["d"]
$daemonize = !params["D"]
More information about the svn-ports-all
mailing list