all: add client id preference config param

So client can chose how client id is generated.
This commit is contained in:
Cuong Manh Le
2023-12-05 21:58:34 +07:00
committed by Cuong Manh Le
parent c3ff8182af
commit 7591a0ccc6
6 changed files with 37 additions and 9 deletions
+1
View File
@@ -67,6 +67,7 @@ func (p *prog) serveDNS(listenerNum string) error {
reqId := requestID()
remoteIP, _, _ := net.SplitHostPort(w.RemoteAddr().String())
ci := p.getClientInfo(remoteIP, m)
ci.ClientIDPref = p.cfg.Service.ClientIDPref
stripClientSubnet(m)
remoteAddr := spoofRemoteAddr(w.RemoteAddr(), ci)
fmtSrcToDest := fmtRemoteToLocal(listenerNum, remoteAddr.String(), w.LocalAddr().String())