Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/android dns #943

Merged
merged 23 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/internal/dns/dbus_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !android

package dns

import (
Expand Down
2 changes: 2 additions & 0 deletions client/internal/dns/file_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !android

package dns

import (
Expand Down
24 changes: 24 additions & 0 deletions client/internal/dns/host_android.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package dns

import (
"github.com/netbirdio/netbird/iface"
)

type androidHostManager struct {
}

func newHostManager(wgInterface *iface.WGIface) (hostManager, error) {
return &androidHostManager{}, nil
}

func (a androidHostManager) applyDNSConfig(config hostDNSConfig) error {
return nil
}

func (a androidHostManager) restoreHostDNS() error {
return nil
}

func (a androidHostManager) supportCustomPort() bool {
return false
}
2 changes: 2 additions & 0 deletions client/internal/dns/host_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !android

package dns

import (
Expand Down
2 changes: 1 addition & 1 deletion client/internal/dns/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (d *localResolver) stop() {

// ServeDNS handles a DNS request
func (d *localResolver) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
log.Tracef("received question: %#v\n", r.Question[0])
log.Tracef("received question: %#v", r.Question[0])
replyMessage := &dns.Msg{}
replyMessage.SetReply(r)
replyMessage.RecursionAvailable = true
Expand Down
4 changes: 4 additions & 0 deletions client/internal/dns/mockServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ func (m *MockServer) Stop() {
}
}

func (m *MockServer) DnsIP() string {
return ""
}

// UpdateDNSServer mock implementation of UpdateDNSServer from Server interface
func (m *MockServer) UpdateDNSServer(serial uint64, update nbdns.Config) error {
if m.UpdateDNSServerFunc != nil {
Expand Down
2 changes: 2 additions & 0 deletions client/internal/dns/network_manager_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !android

package dns

import (
Expand Down
2 changes: 2 additions & 0 deletions client/internal/dns/resolvconf_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !android

package dns

import (
Expand Down
Loading