summaryrefslogtreecommitdiffstats
path: root/src/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-01-20 11:59:06 +0000
committerRoy Marples <roy@marples.name>2020-01-20 11:59:06 +0000
commit75d61aa4e9f34be2c9e83cad52df6a9b57ba9d17 (patch)
treec1992d04c638e87e07c67bfe9ce1c63c2278b17c /src/if-bsd.c
parent52d192bdb01c1fabb749c96376aa7fce67259621 (diff)
downloaddhcpcd-75d61aa4e9f34be2c9e83cad52df6a9b57ba9d17.tar.xz
Only ignore address messages from ourself for deletion.
We need to process addition for flag changes.
Diffstat (limited to 'src/if-bsd.c')
-rw-r--r--src/if-bsd.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/if-bsd.c b/src/if-bsd.c
index 513b4aea..4d455791 100644
--- a/src/if-bsd.c
+++ b/src/if-bsd.c
@@ -1299,16 +1299,21 @@ if_ifa(struct dhcpcd_ctx *ctx, const struct ifa_msghdr *ifam)
}
#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;