diff options
Diffstat (limited to 'ping.nim')
-rw-r--r-- | ping.nim | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -217,11 +217,11 @@ proc initPingMonitor*(target: IpAddress, ident: uint16): PingMonitor = | |||
217 | PingMonitor( | 217 | PingMonitor( |
218 | socket: newSocket(domain, SOCK_RAW, proto), | 218 | socket: newSocket(domain, SOCK_RAW, proto), |
219 | target: target, | 219 | target: target, |
220 | source: getPrimaryIPAddr(target), | ||
221 | ident: ident, | 220 | ident: ident, |
222 | ) | 221 | ) |
223 | 222 | ||
224 | func buildEchoRequest(mon: PingMonitor): ICMPPacket = | 223 | proc buildEchoRequest(mon: PingMonitor): ICMPPacket = |
224 | mon.source = getPrimaryIPAddr(dest=mon.target) | ||
225 | buildEchoRequest(mon.source, mon.target, mon.ident, mon.seqNum, mon.payload) | 225 | buildEchoRequest(mon.source, mon.target, mon.ident, mon.seqNum, mon.payload) |
226 | 226 | ||
227 | proc sendEchoRequest(mon: PingMonitor, timeout: Duration) = | 227 | proc sendEchoRequest(mon: PingMonitor, timeout: Duration) = |