- if dnssyncserver = '' then reportlag(id,(lag.tv_sec*1000000)+lag.tv_usec);\r
- state[socknum].recvpacketlen := recv(fd[socknum],state[socknum].recvpacket, SizeOf(state[socknum].recvpacket),0);\r
- state[socknum].parsepacket := true;\r
- needprocessing[socknum] := true;\r
+ reportlag(id,(lag.tv_sec*1000000)+lag.tv_usec);\r
+\r
+ SrcLen := SizeOf(Src);\r
+ state[socknum].recvpacketlen := recvfrom(fd[socknum],state[socknum].recvpacket, SizeOf(state[socknum].recvpacket),0,Srcx,SrcLen);\r
+\r
+ if (state[socknum].recvpacketlen > 0) then begin\r
+ fromip := inaddrvtobinip(Src);\r
+ fromport := inttostr(htons(src.InAddr.port));\r
+ if ((not comparebinip(toaddr[socknum],fromip)) or (fromport <> toport)) then begin\r
+// writeln('dnssync received from wrong IP:port ',ipbintostr(fromip),'#',fromport);\r
+ state[socknum].recvpacketlen := 0;\r
+ end else begin\r
+ state[socknum].parsepacket := true;\r
+ needprocessing[socknum] := true;\r
+ end;\r
+ end;\r