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

add SunOS support #223

Merged
merged 1 commit into from
Dec 27, 2024
Merged

add SunOS support #223

merged 1 commit into from
Dec 27, 2024

Conversation

cgrzemba
Copy link
Contributor

@cgrzemba cgrzemba commented Dec 9, 2024

This adds basic SunOS support tested on Illumos. Currently the NetworkAddressMonitor do not do dynamic network interface updates. The SMF manifest is not contained.

@christgau
Copy link
Owner

@cgrzemba I refactored the interface enumeration code a little. Could you please check if it still works.

I removed the cleanup routine as there was no work in the class to be done, i.e. there is no socket to be closed or removed from event handling. In addition, I assume that freeifaddrs can be called directly after the enumeration. Would be happy, if you can confirm (I do not have a SunOS/Illumos installation available nor I am familiar)

@cgrzemba
Copy link
Contributor Author

There is an general issue with freeifaddrs so I do an explicit freeing like recommended here
https://stackoverflow.com/questions/60843140/ctypes-how-to-pass-struct-by-reference

@cgrzemba
Copy link
Contributor Author

Should I merge the commits and do an forced update?

@christgau
Copy link
Owner

I added freeing the returned interface address list when enumeration was successful. If that looks good, I'll go ahead and merge

@cgrzemba
Copy link
Contributor Author

Because freeipaddr of libc ends in core I replace the function with a equivalent function in Python

@cgrzemba
Copy link
Contributor Author

The first option, freeing immediate after use, would also work.

@christgau
Copy link
Owner

The first option, freeing immediate after use, would also work.

Would be preferred, from my side,

In addition, I wonder what the socket is used for: https://github.com/cgrzemba/wsdd/blob/6a6f76da8f1f2abd328dda7a2395f775baa4e457/src/wsdd.py#L1795

@cgrzemba
Copy link
Contributor Author

Thanks! I am fine with this code cleanup.

Add initial support for SunOS/Illumos.
Does not support dynamic address monitoring. Addresses are enumerated
when wsdd starts up and changes are not tracked, which might be
sufficient for static server environments.

see christgau#223

Co-authored-by: Steffen Christgau <[email protected]>
@christgau christgau merged commit 15018c5 into christgau:master Dec 27, 2024
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

Successfully merging this pull request may close these issues.

2 participants