If sysctl net.inet.ip.forwarding is set to 2, only packets processed
by IPsec are forwarded. I this case behave more like a router than
a host and do not accept ICMP redirect packets.
OK deraadt@ sashan@ florian@ claudio@
-/* $OpenBSD: ip_icmp.c,v 1.193 2024/06/07 18:24:16 bluhm Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.194 2024/06/20 19:25:04 bluhm Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
struct sockaddr_in ssrc;
struct rtentry *newrt = NULL;
- if (icmp_rediraccept == 0 || ip_forwarding == 1)
+ if (icmp_rediraccept == 0 || ip_forwarding != 0)
goto freeit;
if (code > 3)
goto badcode;