serenity icon indicating copy to clipboard operation
serenity copied to clipboard

Kernel: Make IPv4 TTL configurable

Open Optimoos opened this issue 1 year ago • 3 comments

This change adds default_ttl to /sys/kernel/variables and links the functionality through NetworkingManagement to IPv4 sockets.

DefaultTTL is an IntegerVariable type for retrieving the TTL value from the SysFS file.

NetworkingManagement has a new static variable to store the TTL. This becomes the single point for configuring default TCP/IP TTL on the system.

IPv4Socket and NetworkTask reference the value from NetworkingManagement rather than using their previously hard-coded values. This removes one FIXME from NetworkTask.

This PR is dependent on #19543

Optimoos avatar Jun 21 '23 21:06 Optimoos

There's probably a safer AK helper for string to integer conversion

circl-lastname avatar Jun 22 '23 13:06 circl-lastname

That would impact #19543 - I can adjust there as necessary. However, I'm not sure when/where things are kept to the minimalist kernel libraries (such as KString being used in StringVariable) and where it's okay to reach out to AK - any suggestions?

Optimoos avatar Jun 22 '23 13:06 Optimoos

I apologize I should probably stay within what I know, reviews to your other PR will most likely be made soon about ways you could improve it

circl-lastname avatar Jun 22 '23 15:06 circl-lastname

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Jul 13 '23 21:07 stale[bot]

This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!

stale[bot] avatar Jul 21 '23 00:07 stale[bot]