}
#ifdef HAVE_IFAM_PID
+ /* Ignore address deletions from ourself.
+ * We need to process address flag changes though. */
+ if (ifam->ifam_type == RTM_DELADDR) {
#ifdef PRIVSEP
- if (ctx->ps_root_pid != 0) {
- if (ifam->ifam_pid == ctx->ps_root_pid)
- return 0;
- } else
+ if (ctx->ps_root_pid != 0) {
+ if (ifam->ifam_pid == ctx->ps_root_pid)
+ return 0;
+ } else
#endif
- /* address management is done via ioctl, so SO_USELOOPBACK
- * has no effect, so we do need to check the pid. */
- if (ifam->ifam_pid == getpid())
- return 0;
+ /* address management is done via ioctl,
+ * so SO_USELOOPBACK has no effect,
+ * so we do need to check the pid. */
+ if (ifam->ifam_pid == getpid())
+ return 0;
+ }
pid = ifam->ifam_pid;
#else
pid = 0;
return -1;
}
- /* Ignore messages we sent. */
+ /* Ignore address deletions from ourself.
+ * We need to process address flag changes though. */
+ if (nlm->nlmsg_type == RTM_DELADDR) {
#ifdef PRIVSEP
- if (ctx->ps_root_pid != 0 &&
- nlm->nlmsg_pid == (uint32_t)ctx->ps_root_pid)
- return 0;
+ if (ctx->ps_root_pid != 0 &&
+ nlm->nlmsg_pid == (uint32_t)ctx->ps_root_pid)
+ return 0;
#endif
- priv = (struct priv*)ctx->priv;
- if (nlm->nlmsg_pid == priv->route_pid)
- return 0;
+ priv = (struct priv*)ctx->priv;
+ if (nlm->nlmsg_pid == priv->route_pid)
+ return 0;
+ }
ifa = NLMSG_DATA(nlm);
if ((ifp = if_findindex(ctx->ifaces, ifa->ifa_index)) == NULL) {