NAT debugging

parent c3cbcc80
......@@ -49,6 +49,7 @@ debug: sender( \ extra sender task
debug: dht( \ debugging for dht functions
debug: file( \ file read/write debugging
debug: nat( \ NAT traversal stuff
debug: netlink( \ Netlink changes
debug: route( \ do routing
debug: ipv6( \ use ipv6
debug: ipv4( \ use ipv4
......
......@@ -299,7 +299,8 @@ Forward !my-addr ( -- )
sockaddr1 ipv6( sock-rest )else( sock-rest4 ) 2dup try-ip ;
: ping-addr1 ( -- )
check-addr1 0= IF 2drop EXIT THEN
check-addr1 0= IF nat( ticks .tick ." don't ping: " 2dup .address cr )
2drop EXIT THEN
nat( ticks .ticks ." ping: " 2dup .address cr )
2>r net2o-sock ">" 0 2r> sendto drop ;
......
......@@ -114,12 +114,12 @@ event: ->netlink ( -- )
: new-preferred? ( -- flag )
netlink-wait# ptimeout ! \ 3s wait in total
BEGIN netlink? WHILE read-netlink
nat( 2dup address? IF 2dup .rtaddr THEN ) 2drop
netlink( 2dup address? IF 2dup .rtaddr THEN ) 2drop
REPEAT
check-preferred? ;
: wait-for-address ( -- )
BEGIN read-netlink?
nat( 2dup address? IF 2dup .rtaddr THEN )
netlink( 2dup address? IF 2dup .rtaddr THEN )
address? check-preferred? or UNTIL ;
: netlink-loop ( -- )
netlink-sock 0= IF get-netlink THEN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment