derp/xdp,cmd/xdpderper: initial skeleton (#12390)
This commit introduces a userspace program for managing an experimental eBPF XDP STUN server program. derp/xdp contains the eBPF pseudo-C along with a Go pkg for loading it and exporting its metrics. cmd/xdpderper is a package main user of derp/xdp. Updates tailscale/corp#20689 Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
@ -283,3 +283,19 @@ func TestResponse(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestAttrOrderForXdpDERP(t *testing.T) {
|
||||
// package derp/xdp assumes attribute order. This test ensures we don't
|
||||
// drift and break that assumption.
|
||||
txID := stun.NewTxID()
|
||||
req := stun.Request(txID)
|
||||
if len(req) < 20+12 {
|
||||
t.Fatal("too short")
|
||||
}
|
||||
if !bytes.Equal(req[20:22], []byte{0x80, 0x22}) {
|
||||
t.Fatal("the first attr is not of type software")
|
||||
}
|
||||
if !bytes.Equal(req[24:32], []byte("tailnode")) {
|
||||
t.Fatal("unexpected software attr value")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user