diff --git a/sys/netinet/in.c b/sys/netinet/in.c index a6801b9a4566..4c74b0735857 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -734,6 +734,14 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, if (ia->ia_addr.sin_family == AF_INET) LIST_INSERT_HEAD(INADDR_HASH( ia->ia_addr.sin_addr.s_addr), ia, ia_hash); + else + /* + * If oldaddr family is not AF_INET (e.g. + * interface has been just created) in_control + * does not call LIST_REMOVE, and we end up + * with bogus ia entries in hash + */ + LIST_REMOVE(ia, ia_hash); return (error); } }