mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-04 12:52:15 +00:00
sppp rewrites the interface's ip address directly; this breaks when the
address is looked up via a hash table. Add a hack to move the entry to a new hash bucket when the address changes. Submitted by: tmm
This commit is contained in:
parent
cc33247e33
commit
a743950fc2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84316
@ -4294,6 +4294,9 @@ sppp_set_ip_addr(struct sppp *sp, u_long src)
|
||||
" failed, error=%d\n", SPP_ARGS(ifp), error);
|
||||
}
|
||||
#else
|
||||
#if __FreeBSD_version >= 500023
|
||||
struct in_ifaddr *ia = ifatoia(ifa);
|
||||
#endif
|
||||
/* delete old route */
|
||||
error = rtinit(ifa, (int)RTM_DELETE, RTF_HOST);
|
||||
if(debug && error)
|
||||
@ -4304,7 +4307,10 @@ sppp_set_ip_addr(struct sppp *sp, u_long src)
|
||||
|
||||
/* set new address */
|
||||
si->sin_addr.s_addr = htonl(src);
|
||||
|
||||
#if __FreeBSD_version >= 500023
|
||||
LIST_REMOVE(ia, ia_hash);
|
||||
LIST_INSERT_HEAD(INADDR_HASH(si->sin_addr.s_addr), ia, ia_hash);
|
||||
#endif
|
||||
/* add new route */
|
||||
error = rtinit(ifa, (int)RTM_ADD, RTF_HOST);
|
||||
if (debug && error)
|
||||
|
Loading…
Reference in New Issue
Block a user