diff options
author | melifaro <melifaro@FreeBSD.org> | 2016-01-17 06:02:59 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2016-01-17 06:02:59 +0000 |
commit | db8f77905b5c1c636b0886c5990a8a68cce07bae (patch) | |
tree | c3d51b9fb2efcc84d3753874e4f5e16138957e4b | |
parent | d201d6637a6f2ed9b242604d0c72a05366eb3a4f (diff) | |
download | FreeBSD-src-db8f77905b5c1c636b0886c5990a8a68cce07bae.zip FreeBSD-src-db8f77905b5c1c636b0886c5990a8a68cce07bae.tar.gz |
MFC r288297 (userland part).
If ever MFC is done for the new lltable code, this change will miminise
ABI breakage.
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.
-rw-r--r-- | usr.sbin/arp/arp.c | 5 | ||||
-rw-r--r-- | usr.sbin/ndp/ndp.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index 60f776f..eefde75 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -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); } diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index ada1822..c2fe869 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -655,6 +655,8 @@ again:; if (rtm->rtm_flags & RTF_CLONED) delete(host_buf); #else + if (rtm->rtm_flags & RTF_PINNED) + continue; delete(host_buf); #endif continue; |