]> git.ipfire.org Git - thirdparty/cups.git/commit
Fix behavior of "reserve=rfc1179" in backend/lpd.c 746/head
authorBryan Mason <bmason@redhat.com>
Wed, 28 Jun 2023 19:55:15 +0000 (12:55 -0700)
committerBryan Mason <bmason@redhat.com>
Wed, 28 Jun 2023 19:55:15 +0000 (12:55 -0700)
commit78bc9e3c41b22eb17a9a8961f6f1b467b985b32b
tree4de9bff8fd8f6e71fa2ad72d442989124cbd8585
parenta8eaa67dd10dbaa7856b436ad921ad748f7de0bb
Fix behavior of "reserve=rfc1179" in backend/lpd.c

In backend/lpd.c, if "reserve=rfc1179" is used in the Device URI,
ports from 512-731 will be used instead of only 721=731 as per RFC
1179.

cups_rresvport() starts with the value of lport passed in to the
function and decrements lport to 512 until an open port is found.
Thus, if all ports from 731-721 are unavailable, cups_rresvport() will
start binding to ports between 720-512.

This patch resolves this issue by adding a parameter to
cups_rresvport() that defines the minimum port number that should be
used and makes the appropriate changes in lpd_queue().
backend/lpd.c