Skip to content

Commit

Permalink
REMOVEME: wtf UnixSocket should not even be used here
Browse files Browse the repository at this point in the history
  • Loading branch information
foxxx0 committed Dec 9, 2024
1 parent 6133ddc commit 954cce8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ipv6ll_issue.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require "socket"

gw6ll = "fe80::1%br0"
gw6ll = "fe80::1%6"
puts "== trying to instantiate Socket::IPAddress.new(\"#{gw6ll}\", 0) =="
sock_ipv6ll = Socket::IPAddress.new(gw6ll, 0)
printf " [+] Socket::IPAddress instance = "
pp sock_ipv6ll
printf " [+] Socket::IPAddress .scope_id = "
pp sock_ipv6ll.scope_id

x = Socket::IPAddress.new("fe80::1%asdf", 0)
pp x
pp x.scope_id
4 changes: 4 additions & 0 deletions src/socket/unix_socket.cr
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,8 @@ class UNIXSocket < Socket
message, address = super(max_message_size)
{message, address.as(UNIXAddress)}
end

def receive(message : Bytes) : {Int32, Address}
super(message)
end
end

0 comments on commit 954cce8

Please sign in to comment.