这是indexloc提供的服务,不要输入任何密码
Skip to content

lpd "reserve=rfc1179" actually uses ports 512-731, not 721-731 #743

@bmasonrh

Description

@bmasonrh

While creating PR #741, I noticed that the use of cups_rresvport() will cause ports from 731-512 to be used instead of just 721-731. Since cups_rresvport() starts with the value of lport passed in and decrements lport to 512, if all ports from 731-721 are unavailable, cups_rresvport() will start binding to ports between 720-512.

One possible fix would be to add a parameter to cups_rresvport() to provide a lower bound for port reservation. This would make it incompatible with the glibc function that it was intended to replace, but I don't know if that's important now.

Another possible fix would be to change lpd_queue() to check the value of lport returned by cups_rresvport() and, if *lport < 721 && reserve == RESERVE_RFC117, close the fd and re-set lport to 731.

I'm happy to file a PR if this is something that should be addressed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions