Looks like this is identical to the ipv4 func? If so, I prefer merging them.