Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How does python3 determine whether two IP ranges overlap?
How does python3 determine whether two IP ranges overlap?
Do you want to judge whether two IP segments overlap?

The start/end IP of each IP segment is converted into shaping:

struct.unpack("! l ",socket . inet _ aton(' 192. 168. 1. 152 ')[0]

Then compare whether the two integer segments overlap.