       password = device.InternetGatewayDevice.ManagementServer.ConnectionRequestPassword?._value
 
     conReq = () ->
-      if udpConnectionRequestAddress
-        udpConReq(udpConnectionRequestAddress, username, password, (err) -> throw err if err)
+      udpSent = udpConReq(udpConnectionRequestAddress, username, password, (err) -> throw err if err)
 
       httpConReq(connectionRequestUrl, username, password, CONNECTION_REQUEST_TIMEOUT, (err) ->
-        if udpConnectionRequestAddress
+        if udpSent
           return callback()
         callback(err)
       )



udpConReq = (address, un, key, callback) ->
  [host, port] = address.split(':', 2)

  ts = Math.trunc(Date.now() / 1000)
  id = Math.trunc(Math.random() * 4294967295)

  sig = crypto.createHmac('sha1', key).update("#{ts}#{id}#{un}#{cn}").digest('hex')
  uri = "http://#{address}?ts=#{ts}&id=#{id}&un=#{un}&cn=#{cn}&sig=#{sig}"

  message = Buffer.from("GET #{uri} HTTP/1.1\r\nHost: #{address}\r\n\r\n")

  client = dgram.createSocket('udp4')

