From owner-svn-src-head@freebsd.org Sun Sep 27 04:54:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 861189CF0E3; Sun, 27 Sep 2015 04:54:31 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68310E87; Sun, 27 Sep 2015 04:54:31 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8R4sV7C083063; Sun, 27 Sep 2015 04:54:31 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8R4sUYo083058; Sun, 27 Sep 2015 04:54:30 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201509270454.t8R4sUYo083058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 27 Sep 2015 04:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288297 - in head: sys/netinet sys/netinet6 usr.sbin/arp usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2015 04:54:31 -0000 Author: melifaro Date: Sun Sep 27 04:54:29 2015 New Revision: 288297 URL: https://svnweb.freebsd.org/changeset/base/288297 Log: rtsock requests for deleting interface address lles started to return EPERM instead of old "ignore-and-return 0" in r287789. This broke arp -da / ndp -cn behavior (they exit on rtsock command failure). Fix this by translating LLE_IFADDR to RTM_PINNED flag, passing it to userland and making arp/ndp ignore these entries in batched delete. MFC after: 2 weeks Modified: head/sys/netinet/in.c head/sys/netinet6/in6.c head/usr.sbin/arp/arp.c head/usr.sbin/ndp/ndp.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Sep 27 04:47:08 2015 (r288296) +++ head/sys/netinet/in.c Sun Sep 27 04:54:29 2015 (r288297) @@ -1333,6 +1333,8 @@ in_lltable_dump_entry(struct lltable *ll arpc.rtm.rtm_flags |= (RTF_HOST | RTF_LLDATA); if (lle->la_flags & LLE_STATIC) arpc.rtm.rtm_flags |= RTF_STATIC; + if (lle->la_flags & LLE_IFADDR) + arpc.rtm.rtm_flags |= RTF_PINNED; arpc.rtm.rtm_index = ifp->if_index; error = SYSCTL_OUT(wr, &arpc, sizeof(arpc)); Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Sep 27 04:47:08 2015 (r288296) +++ head/sys/netinet6/in6.c Sun Sep 27 04:54:29 2015 (r288297) @@ -2354,6 +2354,8 @@ in6_lltable_dump_entry(struct lltable *l ndpc.rtm.rtm_flags |= (RTF_HOST | RTF_LLDATA); if (lle->la_flags & LLE_STATIC) ndpc.rtm.rtm_flags |= RTF_STATIC; + if (lle->la_flags & LLE_IFADDR) + ndpc.rtm.rtm_flags |= RTF_PINNED; ndpc.rtm.rtm_index = ifp->if_index; error = SYSCTL_OUT(wr, &ndpc, sizeof(ndpc)); Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Sun Sep 27 04:47:08 2015 (r288296) +++ head/usr.sbin/arp/arp.c Sun Sep 27 04:54:29 2015 (r288297) @@ -673,10 +673,13 @@ print_entry(struct sockaddr_dl *sdl, */ static void nuke_entry(struct sockaddr_dl *sdl __unused, - struct sockaddr_in *addr, struct rt_msghdr *rtm __unused) + struct sockaddr_in *addr, struct rt_msghdr *rtm) { char ip[20]; + if (rtm->rtm_flags & RTF_PINNED) + return; + snprintf(ip, sizeof(ip), "%s", inet_ntoa(addr->sin_addr)); delete(ip); } Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Sun Sep 27 04:47:08 2015 (r288296) +++ head/usr.sbin/ndp/ndp.c Sun Sep 27 04:54:29 2015 (r288297) @@ -649,6 +649,8 @@ again:; if (rtm->rtm_flags & RTF_CLONED) delete(host_buf); #else + if (rtm->rtm_flags & RTF_PINNED) + continue; delete(host_buf); #endif continue;