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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user