Skip to content

Commit 8ad9faf

Browse files
committed
ipn/proxies: allow h3 for uid self
1 parent 44a7c10 commit 8ad9faf

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

intra/ipn/proxies.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,8 @@ func (px *proxifier) ProxyTo(ipp netip.AddrPort, proto, uid string, pids []strin
507507
px.delpin(uid, ipp)
508508
return nil, e(core.JoinErr(err, errProxyRoute))
509509
} // there is only one pid to route to
510-
if maybeH3(proto, ipp) && cantProxyH3(p.ID()) {
510+
if uid != protect.UidSelf && maybeH3(proto, ipp) && cantProxyH3(p.ID()) {
511+
// allow h3 like traffic from uidself, which could actually be rpn/wg on 443
511512
err = errProxyProtoH3
512513
px.delpin(uid, ipp)
513514
return nil, e(core.JoinErr(err, errProxyProtoH3))
@@ -543,7 +544,8 @@ func (px *proxifier) ProxyTo(ipp netip.AddrPort, proto, uid string, pids []strin
543544

544545
hasp := core.IsNotNil(p)
545546
if hasp && p != nil && err != nil {
546-
if maybeH3(proto, ipp) && cantProxyH3(p.ID()) {
547+
// allow h3 like egress from uidself, which could actually be rpn/wg on 443
548+
if uid != protect.UidSelf && maybeH3(proto, ipp) && cantProxyH3(p.ID()) {
547549
err = core.JoinErr(err, errProxyProtoH3)
548550
} else if hasroute(p, ippstr) {
549551
return p, nil
@@ -599,7 +601,9 @@ retrySearch:
599601
continue
600602
}
601603

602-
if maybeH3(proto, ipp) && cantProxyH3(pid) {
604+
// TODO: uidself check only required for loopback mode?
605+
// allow h3 like egress from uidself, which could actually be rpn/wg on 443
606+
if uid != protect.UidSelf && maybeH3(proto, ipp) && cantProxyH3(pid) {
603607
noh3proxies = append(noh3proxies, pid)
604608
continue
605609
}

0 commit comments

Comments
 (0)