-/* $OpenBSD: pf.c,v 1.1203 2024/07/14 18:53:39 bluhm Exp $ */
+/* $OpenBSD: pf.c,v 1.1204 2024/08/06 16:56:09 bluhm Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
action = PF_DROP;
goto out;
}
- if (ip_directedbcast)
+ if (atomic_load_int(&ip_directedbcast))
SET(flags, IP_ALLOWBROADCAST);
ip_forward(pd.m, ifp, NULL, flags);
} else
-/* $OpenBSD: ip_input.c,v 1.400 2024/07/19 16:58:31 bluhm Exp $ */
+/* $OpenBSD: ip_input.c,v 1.401 2024/08/06 16:56:09 bluhm Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
int ip_defttl = IPDEFTTL;
int ip_mtudisc = 1;
int ip_mtudisc_timeout = IPMTUDISCTIMEOUT;
-int ip_directedbcast = 0;
+int ip_directedbcast = 0; /* [a] */
/* Protects `ipq' and `ip_frags'. */
struct mutex ipq_mutex = MUTEX_INITIALIZER(IPL_SOFTNET);
const struct sysctl_bounded_args ipctl_vars_unlocked[] = {
{ IPCTL_FORWARDING, &ip_forwarding, 0, 2 },
{ IPCTL_SENDREDIRECTS, &ip_sendredirects, 0, 1 },
+ { IPCTL_DIRECTEDBCAST, &ip_directedbcast, 0, 1 },
};
const struct sysctl_bounded_args ipctl_vars[] = {
{ IPCTL_MRTPROTO, &ip_mrtproto, SYSCTL_INT_READONLY },
#endif
{ IPCTL_DEFTTL, &ip_defttl, 0, 255 },
- { IPCTL_DIRECTEDBCAST, &ip_directedbcast, 0, 1 },
{ IPCTL_IPPORT_FIRSTAUTO, &ipport_firstauto, 0, 65535 },
{ IPCTL_IPPORT_LASTAUTO, &ipport_lastauto, 0, 65535 },
{ IPCTL_IPPORT_HIFIRSTAUTO, &ipport_hifirstauto, 0, 65535 },
SET(flags, IP_FORWARDING);
break;
}
- if (ip_directedbcast)
+ if (atomic_load_int(&ip_directedbcast))
SET(flags, IP_ALLOWBROADCAST);
hlen = ip->ip_hl << 2;
return (error);
case IPCTL_FORWARDING:
case IPCTL_SENDREDIRECTS:
+ case IPCTL_DIRECTEDBCAST:
return (sysctl_bounded_arr(
ipctl_vars_unlocked, nitems(ipctl_vars_unlocked),
name, namelen, oldp, oldlenp, newp, newlen));