Palace Chan
Palace Chan

Reputation: 9183

Is he->h_addr_list[0] always the default interface?

In the gethostbyname call after passing it the result from gethostname..I get a pointer to a hostent struct. If the localhost has several interfaces, is the zero indexed one the default one used when that host sends multicast?

Upvotes: 2

Views: 95

Answers (1)

R.. GitHub STOP HELPING ICE
R.. GitHub STOP HELPING ICE

Reputation: 215257

No, there is no particular ordering of the results. They don't even necessarily correspond to interfaces for the same machine; they might be a number of separate machines serving round-robin for the dns name.

Upvotes: 2

Related Questions