diff options
author | ume <ume@FreeBSD.org> | 2014-05-29 01:43:27 +0800 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2014-05-29 01:43:27 +0800 |
commit | 07100c0135ca05a48a005dea01024716f9d0b4a1 (patch) | |
tree | f39016b96e9840ac6e6f062eb2d1a44b139bb5b3 /net/dtcp | |
parent | 8db1e5427c0836d72c1e40ab0ed2b2cef6e2971b (diff) | |
download | freebsd-ports-gnome-07100c0135ca05a48a005dea01024716f9d0b4a1.tar.gz freebsd-ports-gnome-07100c0135ca05a48a005dea01024716f9d0b4a1.tar.zst freebsd-ports-gnome-07100c0135ca05a48a005dea01024716f9d0b4a1.zip |
- Set username to descr during interface is in use.
- Make dtcpc_fib work.
Diffstat (limited to 'net/dtcp')
-rw-r--r-- | net/dtcp/Makefile | 2 | ||||
-rw-r--r-- | net/dtcp/files/dtcpc.in | 3 | ||||
-rw-r--r-- | net/dtcp/files/patch-dtcpc.rb | 70 | ||||
-rw-r--r-- | net/dtcp/files/patch-dtcps.rb | 38 |
4 files changed, 105 insertions, 8 deletions
diff --git a/net/dtcp/Makefile b/net/dtcp/Makefile index 13ab16459575..191c2313eca0 100644 --- a/net/dtcp/Makefile +++ b/net/dtcp/Makefile @@ -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/ diff --git a/net/dtcp/files/dtcpc.in b/net/dtcp/files/dtcpc.in index 0d7e32cdc0a9..3a747a3addad 100644 --- a/net/dtcp/files/dtcpc.in +++ b/net/dtcp/files/dtcpc.in @@ -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" diff --git a/net/dtcp/files/patch-dtcpc.rb b/net/dtcp/files/patch-dtcpc.rb new file mode 100644 index 000000000000..a63ead05b960 --- /dev/null +++ b/net/dtcp/files/patch-dtcpc.rb @@ -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"] diff --git a/net/dtcp/files/patch-dtcps.rb b/net/dtcp/files/patch-dtcps.rb index dd950da14526..bea1832ee408 100644 --- a/net/dtcp/files/patch-dtcps.rb +++ b/net/dtcp/files/patch-dtcps.rb @@ -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"] |