Opened 16 years ago
Closed 16 years ago
#800 closed defect (fixed)
Change in IP address selection algorithm (the pj_gethostip() function)
Reported by: | bennylp | Owned by: | bennylp |
---|---|---|---|
Priority: | normal | Milestone: | release-1.2 |
Component: | pjlib | Version: | trunk |
Keywords: | Cc: | ||
Backport to 1.x milestone: | Backported: |
Description
Currently the pj_gethostip() function gets the IP address from the following algorithm:
- get the IP of the hostname
- if IP is not usable, get the default interface
- if failed, get the first interface
- if failed, return loopback address
Note: failed or not-usable means the query failed or the returned IP address is loopback IP or other non-usable IP.
One of the problem with above approach is sometimes a "good" IP address is returned from the step 1, but the IP is not usable (for example, the interface is down).
A better solution perhaps is to list all the addresses above, give them some weight, and return the one with the "best" value.
Change History (1)
comment:1 Changed 16 years ago by bennylp
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
Done in r2656: