summaryrefslogtreecommitdiffstats
path: root/src/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-01-16 21:56:35 +0000
committerRoy Marples <roy@marples.name>2020-01-16 21:56:35 +0000
commit6455ae5492e018eb6275dc191fbd94ad95fa9202 (patch)
tree0662ce581e6e5c978f8605646d96b0794b95720b /src/if-bsd.c
parent27d704b6b325c59cd3aa3bf80bf5476508fbc07e (diff)
downloaddhcpcd-6455ae5492e018eb6275dc191fbd94ad95fa9202.tar.xz
BSD: Disable checking rtm_pid and comment why.
It's because we turn off SO_USELOOPBACK. Also note that this trick does NOT work for addresses.
Diffstat (limited to 'src/if-bsd.c')
-rw-r--r--src/if-bsd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/if-bsd.c b/src/if-bsd.c
index 6fddb02e..717c49e0 100644
--- a/src/if-bsd.c
+++ b/src/if-bsd.c
@@ -1250,10 +1250,14 @@ if_rtm(struct dhcpcd_ctx *ctx, const struct rt_msghdr *rtm)
if (ctx->ps_root_pid != 0) {
if (rtm->rtm_pid == ctx->ps_root_pid)
return 0;
- } else
+ }
+#endif
+
+#if 0
+ /* Not needed because we turn off SO_USELOOPBACK. */
+ if (rtm->rtm_pid == getpid())
+ return 0;
#endif
- if (rtm->rtm_pid == getpid())
- return 0;
if (if_copyrt(ctx, &rt, rtm) == -1)
return errno == ENOTSUP ? 0 : -1;
@@ -1303,6 +1307,8 @@ if_ifa(struct dhcpcd_ctx *ctx, const struct ifa_msghdr *ifam)
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;
pid = ifam->ifam_pid;