diff options
author | melifaro <melifaro@FreeBSD.org> | 2015-09-27 04:54:29 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2015-09-27 04:54:29 +0000 |
commit | 4fed811000ba5b64a4b7fba73ed6c0590038ab48 (patch) | |
tree | b8bd529bc94d7864472e3eae47cfdc76698c9f0b | |
parent | 5d0f31382ff2eb2e0ef0a1e21c6edd686c7132a2 (diff) | |
download | FreeBSD-src-4fed811000ba5b64a4b7fba73ed6c0590038ab48.zip FreeBSD-src-4fed811000ba5b64a4b7fba73ed6c0590038ab48.tar.gz |
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
-rw-r--r-- | sys/netinet/in.c | 2 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 2 | ||||
-rw-r--r-- | usr.sbin/arp/arp.c | 5 | ||||
-rw-r--r-- | usr.sbin/ndp/ndp.c | 2 |
4 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index b582ba1..1441936 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1333,6 +1333,8 @@ in_lltable_dump_entry(struct lltable *llt, struct llentry *lle, 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)); diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 9996dbf..af62ed1 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2354,6 +2354,8 @@ in6_lltable_dump_entry(struct lltable *llt, struct llentry *lle, 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)); 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 4837b06..a14520c 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -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; |