This paper proposes a transparent packet pre-marking method named QLR (QoS Library Redirection) for DiffServ. This method can upgrade legacy applications to obtain packet pre-marking ability without any modification of source codes. In this case, users are allowed to purchase high or low service quality according to their requirements. The major techniques of QLR include the dynamic linking of shared libraries and the function call redirection. We have upgraded the vic application by using QLR in our FreeBSD testing platform. The experimental results can show the effectiveness of the QLR