Skip to content

Commit 7f7680b

Browse files
committed
tcp,udp,icmp,dns: trim space on csv ids
1 parent 72e11d3 commit 7f7680b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

intra/common.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ func (h *baseHandler) judge(decision *Mark, aux ...string) (cid, uid, fid string
604604
pids = []string{ipn.Block}
605605
return
606606
}
607+
v = strings.TrimSpace(v)
607608
if len(v) > 0 {
608609
pids = append(pids, v)
609610
}

intra/dnsx/transport.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,7 @@ func (r *resolver) preferencesFrom(qname string, qtyp uint16, s *x.DNSOpts, chos
10081008
if y := strings.Split(s.IPCSV, ","); len(y) > 0 {
10091009
ips = make([]netip.Addr, 0, len(y))
10101010
for _, a := range y {
1011+
a = strings.TrimSpace(a)
10111012
if len(a) <= 0 {
10121013
continue
10131014
}
@@ -1124,6 +1125,7 @@ func (r *resolver) chooseOne(ids ...string) (theone string) {
11241125
trs := make([]Transport, 0, len(ids))
11251126
r.RLock()
11261127
for _, id := range ids {
1128+
id = strings.TrimSpace(id)
11271129
if t := r.transports[id]; t != nil {
11281130
trs = append(trs, t)
11291131
}

0 commit comments

Comments
 (0)