diff options
author | jlemon <jlemon@FreeBSD.org> | 2001-10-01 18:03:56 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2001-10-01 18:03:56 +0000 |
commit | 9453c7902bf96769d12b7fb46b5658086c0dd14b (patch) | |
tree | 2c362d3eefeb4bdfc6bdccea091247616f3fe336 /sys/i4b/driver | |
parent | b607d229d2637ec738c04a04a0fa9fb82bd61a9b (diff) | |
download | FreeBSD-src-9453c7902bf96769d12b7fb46b5658086c0dd14b.zip FreeBSD-src-9453c7902bf96769d12b7fb46b5658086c0dd14b.tar.gz |
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
Diffstat (limited to 'sys/i4b/driver')
-rw-r--r-- | sys/i4b/driver/i4b_ispppsubr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/i4b/driver/i4b_ispppsubr.c b/sys/i4b/driver/i4b_ispppsubr.c index 3e47912..b6f764e 100644 --- a/sys/i4b/driver/i4b_ispppsubr.c +++ b/sys/i4b/driver/i4b_ispppsubr.c @@ -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) |