1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-13 03:03:15 +00:00
freebsd-ports/net/dtcp/files/patch-dtcpc.rb
Hajimu UMEMOTO 32b02e6a47 - Set username to descr during interface is in use.
- Make dtcpc_fib work.
2014-05-28 17:43:27 +00:00

71 lines
1.4 KiB
Ruby

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"]