There is no need to check for unique addr+port for FDs passed by a supervisor process like systemd.
I am not sure if this is the best way to address this issue.
We ran into this issue at Cloudflare because we use a patched kernel that allows us to bind to a network prefix. The rationale for using this is so that rrdns(Cloudflare authoratative DNS) and kresd both can bind to tcp port 53 but use kernel logic to match prefix and route to appropriate process. Binding to individual IPs on rrdns is not possible because of the amount of IPs we are dealing with.
We have multiple sockets bound to different prefixes but socket address is always INADDR_ANY, see below for an example
Jan 17 20:59:30 localhost systemd[1]: Starting Knot Resolver...
Jan 17 20:59:30 localhost kresd.new[5037]: [system] fd=3 :::53
Jan 17 20:59:30 localhost kresd.new[5037]: [system] fd=4 x.x.x.x:53
Jan 17 20:59:30 localhost kresd.new[5037]: [system] fd=5 aa::bb:53
Jan 17 20:59:30 localhost kresd.new[5037]: [system] fd=6 y.y.y.y:53
Jan 17 20:59:30 localhost kresd.new[5037]: [system] fd=7 cc::dd:53
Jan 17 20:59:30 localhost kresd.new[5037]: [system] fd=8 :::53
Jan 17 20:59:30 localhost kresd.new[5037]: [system] listen on fd=8 File exists
Jan 17 20:59:30 localhost kresd.new[5037]: [system] fd=9 :::853
Jan 17 20:59:30 localhost kresd.new[5037]: [system] fd=10 :::853
Jan 17 20:59:30 localhost kresd.new[5037]: [system] TLS listen on fd=10 File exists
Jan 17 20:59:30 localhost systemd[1]: kresd.service: Main process exited, code=exited, status=1/FAILURE
Jan 17 20:59:30 localhost systemd[1]: Failed to start Knot Resolver.
Jan 17 20:59:30 localhost systemd[1]: kresd.service: Unit entered failed state.
Jan 17 20:59:30 localhost systemd[1]: kresd.service: Failed with result 'exit-code'.