summaryrefslogtreecommitdiffstats
path: root/src/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2018-03-06 08:55:11 +0000
committerRoy Marples <roy@marples.name>2018-03-06 08:55:11 +0000
commitc8d1a4150812b2d01c9cc2e5272a2ba19bc0196f (patch)
tree04a731a655be459cc6fc5d1503a2f5b0b920c159 /src/if-bsd.c
parent94b342061f5b93b05ca9a43ea30997113da332d3 (diff)
downloaddhcpcd-c8d1a4150812b2d01c9cc2e5272a2ba19bc0196f.tar.xz
Log the pid of the process deleting an assigned address.
This should make debugging easier with third party software.
Diffstat (limited to 'src/if-bsd.c')
-rw-r--r--src/if-bsd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/if-bsd.c b/src/if-bsd.c
index 824d4fd8..f259e821 100644
--- a/src/if-bsd.c
+++ b/src/if-bsd.c
@@ -1040,6 +1040,7 @@ if_ifa(struct dhcpcd_ctx *ctx, const struct ifa_msghdr *ifam)
struct interface *ifp;
const struct sockaddr *rti_info[RTAX_MAX];
int addrflags;
+ pid_t pid;
if ((ifp = if_findindex(ctx->ifaces, ifam->ifam_index)) == NULL)
return;
@@ -1068,6 +1069,9 @@ if_ifa(struct dhcpcd_ctx *ctx, const struct ifa_msghdr *ifam)
}
#endif
}
+ pid = ifam->ifam_pid;
+#else
+ pid = 0;
#endif
#ifdef HAVE_IFAM_ADDRFLAGS
@@ -1140,7 +1144,7 @@ if_ifa(struct dhcpcd_ctx *ctx, const struct ifa_msghdr *ifam)
#endif
ipv4_handleifa(ctx, ifam->ifam_type, NULL, ifp->name,
- &addr, &mask, &bcast, addrflags);
+ &addr, &mask, &bcast, addrflags, pid);
break;
}
#endif
@@ -1171,7 +1175,7 @@ if_ifa(struct dhcpcd_ctx *ctx, const struct ifa_msghdr *ifam)
#endif
ipv6_handleifa(ctx, ifam->ifam_type, NULL,
- ifp->name, &addr6, ipv6_prefixlen(&mask6), addrflags);
+ ifp->name, &addr6, ipv6_prefixlen(&mask6), addrflags, pid);
break;
}
#endif