In rtredirect() change an bad assignment in an if condition to the
authorclaudio <claudio@openbsd.org>
Mon, 7 Feb 2022 11:03:34 +0000 (11:03 +0000)
committerclaudio <claudio@openbsd.org>
Mon, 7 Feb 2022 11:03:34 +0000 (11:03 +0000)
correct equality check.
Found by and OK jsg@

sys/net/route.c

index 641469b..44a0e75 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: route.c,v 1.400 2022/01/02 22:36:04 jsg Exp $ */
+/*     $OpenBSD: route.c,v 1.401 2022/02/07 11:03:34 claudio Exp $     */
 /*     $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $      */
 
 /*
@@ -584,7 +584,7 @@ rtredirect(struct sockaddr *dst, struct sockaddr *gateway,
        if (rt != NULL && (!equal(src, rt->rt_gateway) || rt->rt_ifa != ifa))
                error = EINVAL;
        else if (ifa_ifwithaddr(gateway, rdomain) != NULL ||
-           (gateway->sa_family = AF_INET &&
+           (gateway->sa_family == AF_INET &&
            in_broadcast(satosin(gateway)->sin_addr, rdomain)))
                error = EHOSTUNREACH;
        if (error)