Move ipv4 arguments handling to a separate function. No fucntional change.