I will concur with the whole 'llm keeps suggesting to reinvent the wheel'
And poorly. Not only did it not use a pretty basic standard library to do something, it's implementation is generally crap. For example it offered up a solution that was hard coded to IPv4, and the context was very ipv6 heavy