Skip to content

Commit

Permalink
feat(adguardhome): revert "skip setting control msg for udp server"
Browse files Browse the repository at this point in the history
  • Loading branch information
laggardkernel committed Aug 16, 2021
1 parent bb71b66 commit 1ea8ae2
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions Formula/adguardhome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,29 +99,6 @@ def install

system "make", "go-deps"

if OS.mac?
# https://github.com/AdguardTeam/AdGuardHome/issues/2807
# Dir["#{ENV["GOPATH"]}/pkg/mod/github.com/*/dnsproxy@*/proxy/server_udp.go"].each do |dst|
# # inreplace = cp + mod + mv
# chmod 0666, dst
# chmod 0777, File.dirname(dst)
# inreplace dst do |s|
# s.gsub! "err = proxyutil.UDPSetOptions(udpListen)", "err = nil"
# end
# # system is called in subprocess, seems not current user, read err
# # system "/usr/bin/sed", "-i", "''", "s/err = proxyutil.UDPSetOptions(udpListen)/err = nil/", dst
# end
Dir["#{ENV["GOPATH"]}/pkg/mod/github.com/*/dnsproxy@*/proxyutil/udp_unix.go"].each do |dst|
# Skip setting control msg for ipv4 udp conn, which impact listening addr
# err4 := ipv4.NewPacketConn(c).SetControlMessage(ipv4.FlagDst|ipv4.FlagInterface, true)
chmod 0666, dst
chmod 0777, File.dirname(dst)
inreplace dst do |s|
s.gsub!(/err4\s*:=\s*ipv4.NewPacketConn.+SetControlMessage.+/, "var err4 *int")
end
end
end

system "make", "CHANNEL=#{channel}", "VERSION=#{version_str}", "go-build"
system "upx", "-9", "-q", "AdGuardHome"
end
Expand Down

0 comments on commit 1ea8ae2

Please sign in to comment.