diff --git a/processing.go b/processing.go index 77a97937..c318f069 100644 --- a/processing.go +++ b/processing.go @@ -88,7 +88,13 @@ func (target *ScanTarget) OpenTLS(baseFlags *BaseFlags, tlsFlags *TLSFlags) (*TL // OpenUDP connects to the ScanTarget using the configured flags, and returns a net.Conn that uses the configured timeouts for Read/Write operations. // Note that the UDP "connection" does not have an associated timeout. func (target *ScanTarget) OpenUDP(flags *BaseFlags, udp *UDPFlags) (net.Conn, error) { - var port uint = *target.Port | flags.Port + var port uint + // If the port is supplied in ScanTarget, let that override the cmdline option + if target.Port != nil { + port = *target.Port + } else { + port = flags.Port + } address := net.JoinHostPort(target.Host(), fmt.Sprintf("%d", port)) var local *net.UDPAddr