From: Roy Marples Date: Thu, 16 Jan 2020 21:56:35 +0000 (+0000) Subject: BSD: Disable checking rtm_pid and comment why. X-Git-Tag: v9.0.0~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6c3ee30322f03fae02f6d49a29aef1fc23223bd;p=thirdparty%2Fdhcpcd.git 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. --- 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;