From e5a8f7c0bbfc9c547ed588e92b445bbb7a03ecd9 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Wed, 27 Nov 2024 21:18:27 +0900 Subject: [PATCH] loxilb-io/loxilb#675 Fixed minor issues for proxy protocol v2 support --- loxilb-ebpf | 2 +- pkg/loxinet/rules.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/loxilb-ebpf b/loxilb-ebpf index 9d182a28..46ead7d3 160000 --- a/loxilb-ebpf +++ b/loxilb-ebpf @@ -1 +1 @@ -Subproject commit 9d182a2877d2b3a91d13d9c69e468a7e18a69b3b +Subproject commit 46ead7d3fcd3674f34f2b9446d9f76bbc84ae791 diff --git a/pkg/loxinet/rules.go b/pkg/loxinet/rules.go index 531f4e63..ae662398 100644 --- a/pkg/loxinet/rules.go +++ b/pkg/loxinet/rules.go @@ -1559,6 +1559,10 @@ func (R *RuleH) AddLbRule(serv cmn.LbServiceArg, servSecIPs []cmn.LbSecIPArg, al return RuleUnknownServiceErr, errors.New("malformed-service error") } + if serv.ProxyProtocolV2 && serv.Proto != "tcp" { + return RuleUnknownServiceErr, errors.New("proxy-proto-v2 not tcp service error") + } + if serv.Proto == "tcp" { ipProto = 6 } else if serv.Proto == "udp" {