diff options
author | ume <ume@FreeBSD.org> | 2014-05-19 19:04:19 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2014-05-19 19:04:19 +0000 |
commit | f855331dcb3ead3fda2c184a3cb0a516443de2f3 (patch) | |
tree | ebf7e2f76fb9133856db19e0d204de1711ba202e | |
parent | cb238bad4ffc3fd5a9d17e76602b906581a9070d (diff) | |
download | FreeBSD-ports-f855331dcb3ead3fda2c184a3cb0a516443de2f3.zip FreeBSD-ports-f855331dcb3ead3fda2c184a3cb0a516443de2f3.tar.gz |
Make ${dtcps_fib} work.
-rw-r--r-- | net/dtcp/Makefile | 2 | ||||
-rw-r--r-- | net/dtcp/files/dtcps.in | 3 | ||||
-rw-r--r-- | net/dtcp/files/patch-dtcps.rb | 69 |
3 files changed, 73 insertions, 1 deletions
diff --git a/net/dtcp/Makefile b/net/dtcp/Makefile index cf19fbf..13ab164 100644 --- a/net/dtcp/Makefile +++ b/net/dtcp/Makefile @@ -2,7 +2,7 @@ PORTNAME= dtcp PORTVERSION= 20130602 -#PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= net ipv6 MASTER_SITES= http://www.mahoroba.org/~ume/ipv6/ \ http://home.jp.FreeBSD.org/~ume/ipv6/ diff --git a/net/dtcp/files/dtcps.in b/net/dtcp/files/dtcps.in index 6f3693a..248102e 100644 --- a/net/dtcp/files/dtcps.in +++ b/net/dtcp/files/dtcps.in @@ -54,4 +54,7 @@ dtcps_prestart() { load_rc_config $name command_args="-i ${dtcps_tunif} ${dtcps_prefix}" +if [ -n "${dtcps_fib}" ]; then + command_args="-F ${dtcps_fib} ${command_args}" +fi run_rc_command "$1" diff --git a/net/dtcp/files/patch-dtcps.rb b/net/dtcp/files/patch-dtcps.rb new file mode 100644 index 0000000..dd950da --- /dev/null +++ b/net/dtcp/files/patch-dtcps.rb @@ -0,0 +1,69 @@ +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 @@ + 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::[^ ]*)/ +@@ -226,6 +230,9 @@ + end + } + end ++ if $fibnum >= 0 ++ setfib($fibnum) ++ end + @created = true + end + +@@ -291,6 +298,9 @@ + if !@tunif || @tunif == "ng" + @name = mkpeer + @created = true ++ if $fibnum >= 0 ++ setfib($fibnum) ++ end + return + end + +@@ -306,6 +316,9 @@ + @name = mkpeer + if @name == @tunif + @created = true ++ if $fibnum >= 0 ++ setfib($fibnum) ++ end + break + end + +@@ -1173,13 +1186,14 @@ + $tunif = TUNIF + $ng_tunif = "ng" + $cloning = TUNIF_CLONING ++$fibnum = -1 + $global = nil + $prefix = nil + $network_with_peeraddr = nil + $udp_tunnel_port = UDP_TUNNEL_PORT + + begin +- params = ARGV.getopts('ab:cdDg:i:I:op:U') ++ params = ARGV.getopts('ab:cdDF:g:i:I:op:U') + rescue + usage() + exit 0 +@@ -1190,6 +1204,7 @@ + $cloning = false if params["c"] + $debug = params["d"] + $daemonize = !params["D"] ++$fibnum = params["F"].to_i if params["F"] + $global = params["g"] if params["g"] + $tunif = params["i"] if params["i"] + $ng_tunif = params["I"] if params["I"] |