Skip to content

Commit c5d15cd

Browse files
authored
Merge pull request #4054 from AkihiroSuda/fix-4040
limayaml/defaults.go: allow automatic UDP forwarding
2 parents cc46912 + d8feb58 commit c5d15cd

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

pkg/limayaml/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ func executeHostTemplate(format, instDir string, param map[string]string) (bytes
901901

902902
func FillPortForwardDefaults(rule *limatype.PortForward, instDir string, user limatype.User, param map[string]string) {
903903
if rule.Proto == "" {
904-
rule.Proto = limatype.ProtoTCP
904+
rule.Proto = limatype.ProtoAny
905905
}
906906
if rule.GuestIP == nil {
907907
if rule.GuestIPMustBeZero {

pkg/limayaml/defaults_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func TestFillDefault(t *testing.T) {
128128
GuestPortRange: [2]int{1, 65535},
129129
HostIP: IPv4loopback1,
130130
HostPortRange: [2]int{1, 65535},
131-
Proto: limatype.ProtoTCP,
131+
Proto: limatype.ProtoAny,
132132
Reverse: false,
133133
}
134134

templates/default.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ networks:
508508
#
509509
# # Lima internally appends this fallback rule at the end:
510510
# - guestIP: "127.0.0.1"
511+
# proto: "any"
511512
# guestPortRange: [1, 65535]
512513
# hostIP: "127.0.0.1"
513514
# hostPortRange: [1, 65535]

0 commit comments

Comments
 (0)