Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot specify state for UDP protocol #322

Open
informatik01 opened this issue Aug 4, 2024 · 3 comments
Open

[BUG] Cannot specify state for UDP protocol #322

informatik01 opened this issue Aug 4, 2024 · 3 comments

Comments

@informatik01
Copy link

informatik01 commented Aug 4, 2024

Describe the bug

The documented feature of filtering processes that use UDP protocol with the specified state does not work on the latest (at the time of writing this) version of macOS Sonoma 14.6.

To Reproduce

Steps to reproduce the behavior (tried both the macOS supplied lsof revision 4.91 and the latest version 4.99.3 installed using Homebrew):

  1. Run this example from the lsof man documentation: sudo lsof -iUDP -sUDP:Idle
  2. See error:

lsof: unknown -s protocol: "UDP:Idle"

Expected behavior

The normal output showing the results if present.

Program output

lsof: unknown -s protocol: "UDP:Idle"
lsof 4.91
latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ
latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man
usage: [-?abhlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-f[cgG]]
[-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]] [-p s]
[+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]
Use the ``-h'' option to get more help information.


Environment (please complete the following information):

  • Kernel: Darwin Kernel Version 23.6.0
  • OS: macOS Sonoma 14.6 (23G80)
  • lsof Version: 4.91 and 4.99.3
  • Origin: version 4.91 that came with macOS and version 4.99.3 that was installed using Homebrew

Additional context

Quote from the man lsof documentation:

Two common UDP state names are Unbound and Idle.

@informatik01 informatik01 changed the title [BUG] [BUG] Cannot specify state for UDP protocol Aug 4, 2024
@jiegec
Copy link
Contributor

jiegec commented Aug 4, 2024

The real problem is, the macOS kernel does not provide the information to lsof: no UDP socket info in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/proc_info.h

@informatik01
Copy link
Author

@jiegec
So there is no solution / workaround to this problem?

If not, at least it would be nice to mention such moments in the man documentation to avoid confusion. It's not uncommon to mention platform specific nuances in the documentation so that users would be aware etc.

@jiegec
Copy link
Contributor

jiegec commented Aug 5, 2024

@jiegec So there is no solution / workaround to this problem?

No that I am aware as of now. But I am not expert on this, you could investigate further to see if there is such way to find status.

If not, at least it would be nice to mention such moments in the man documentation to avoid confusion. It's not uncommon to mention platform specific nuances in the documentation so that users would be aware etc.

That's correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants