1
0
mirror of https://code.semirocket.science/wrapsix synced 2025-12-08 09:55:13 +02:00

Improved creating of a socket for the resolver

Written new mechanism of wrapper from scratch in C
* It listens to all ICMPv6 packets (for now) and translates them to ICMPv4 ones
* It can compute the checksum of the packet as well
This commit is contained in:
xHire
2008-12-31 13:41:21 +01:00
parent c27f79705f
commit 4bc68edce5
11 changed files with 426 additions and 7 deletions

View File

@@ -18,11 +18,14 @@ class Resolver
def start
@resolver = UDPSocket.open Socket::AF_INET6
if @resolver.bind $config['resolver_ip'], 53
puts "Started DNS resolver on IPv6 address #{$config['resolver_ip']}" if @debug
else
puts "DNS resolver not started!" if @debug
begin
@resolver.bind $config['resolver_ip'], 53
#rescue Errno::EPERM
rescue Errno::EACCES
$stderr.puts "You have to run #{$0} as root!"
exit!
end
puts "Started DNS resolver on IPv6 address #{$config['resolver_ip']}" if @debug
loop do
puts "---------- start ----------" if @debug