Merge branch 'freebsd/current/main' into hardened/current/master

This commit is contained in:
HardenedBSD Sync Services 2024-11-13 18:01:29 -07:00
commit f56c1daf36
No known key found for this signature in database
25 changed files with 376 additions and 95 deletions

View File

@ -299,6 +299,7 @@ MAN+= abort2.2 \
rmdir.2 \
rtprio.2 \
sched_get_priority_max.2 \
sched_getcpu.3 \
sched_setparam.2 \
sched_setscheduler.2 \
sched_yield.2 \

51
lib/libsys/sched_getcpu.3 Normal file
View File

@ -0,0 +1,51 @@
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2024 The FreeBSD Foundation
.\"
.\" This documentation was written by Ed Maste <emaste@FreeBSD.org>
.\" under sponsorship from the FreeBSD Foundation.
.\"
.Dd November 13, 2024
.Dt SCHED_GETCPU 3
.Os
.Sh NAME
.Nm sched_getcpu
.Nd get current CPU
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In sched.h
.Ft int
.Fn sched_getcpu void
.Sh DESCRIPTION
The
.Fn sched_getcpu
function returns the current CPU on which the calling thread is running.
.Sh RETURN VALUES
.Fn sched_getcpu
returns the 0-based index of the current CPU at the time of the call.
The value may become invalid immediately after return, unless the thread is
pinned to a specific CPU.
CPU numbering is the same as used by
.Xr cpuset 2
and CPU affinity calls.
.Pp
There are no error values as
.Fn sched_getcpu
does not fail.
.Sh SEE ALSO
.Xr cpuset 2 ,
.Xr cpuset_getaffinity 2 ,
.Xr cpuset_setaffinity 2 ,
.Xr pthread_getaffinity_np 3 ,
.Xr pthread_setaffinity_np
.Sh STANDARDS
The
.Nm
function originated in Linux.
This implementation aims to be source-compatible with the Linux implementation.
.Sh HISTORY
The
.Nm
function was introduced in
.Fx 13.1 .

View File

@ -59,7 +59,7 @@ a. m.
p. m.
#
# date_fmt
%A, %e de %B de %Y, %X %Z
%A, %e %B de %Y, %X %Z
#
# Long month names (without case ending)
de gener

View File

@ -63,7 +63,7 @@ a. m.
p. m.
#
# date_fmt
%A, %e de %B de %Y, %X %Z
%A, %e %B de %Y, %X %Z
#
# Long month names (without case ending)
de gener

View File

@ -2783,7 +2783,7 @@ lkpi_vif_iflladdr(void *arg, struct ifnet *ifp)
}
vif = arg;
IEEE80211_ADDR_COPY(vif->bss_conf.addr, IF_LLADDR(ifp));
IEEE80211_ADDR_COPY(vif->bss_conf.addr, if_getlladdr(ifp));
NET_EPOCH_EXIT(et);
}

View File

@ -946,8 +946,8 @@ int bnxt_re_setup_cnp_cos(struct bnxt_re_dev *rdev, bool reset);
static inline enum ib_port_state bnxt_re_get_link_state(struct bnxt_re_dev *rdev)
{
if (rdev->netdev->if_drv_flags & IFF_DRV_RUNNING &&
rdev->netdev->if_link_state == LINK_STATE_UP)
if (if_getdrvflags(rdev->netdev) & IFF_DRV_RUNNING &&
if_getlinkstate(rdev->netdev) == LINK_STATE_UP)
return IB_PORT_ACTIVE;
return IB_PORT_DOWN;
}

View File

@ -299,7 +299,7 @@ int bnxt_re_query_port(struct ib_device *ibdev, u8 port_num,
if (port_attr->state == IB_PORT_ACTIVE)
port_attr->phys_state = IB_PORT_PHYS_STATE_LINK_UP;
port_attr->max_mtu = IB_MTU_4096;
port_attr->active_mtu = iboe_get_mtu(rdev->netdev->if_mtu);
port_attr->active_mtu = iboe_get_mtu(if_getmtu(rdev->netdev));
port_attr->gid_tbl_len = dev_attr->max_sgid;
port_attr->port_cap_flags = IB_PORT_CM_SUP | IB_PORT_REINIT_SUP |
IB_PORT_DEVICE_MGMT_SUP |
@ -2118,7 +2118,7 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd,
qplqp->max_rd_atomic = dev_attr->max_qp_rd_atom;
qplqp->max_dest_rd_atomic = dev_attr->max_qp_init_rd_atom;
}
qplqp->mtu = ib_mtu_enum_to_int(iboe_get_mtu(rdev->netdev->if_mtu));
qplqp->mtu = ib_mtu_enum_to_int(iboe_get_mtu(if_getmtu(rdev->netdev)));
qplqp->dpi = &rdev->dpi_privileged; /* Doorbell page */
if (init_attr->create_flags) {
dev_dbg(rdev_to_dev(rdev),
@ -2691,7 +2691,7 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr,
/* MTU settings allowed only during INIT -> RTR */
if (qp_attr->qp_state == IB_QPS_RTR) {
bnxt_re_init_qpmtu(qp, rdev->netdev->if_mtu, qp_attr_mask, qp_attr,
bnxt_re_init_qpmtu(qp, if_getmtu(rdev->netdev), qp_attr_mask, qp_attr,
&is_qpmtu_high);
if (udata && !ib_copy_from_udata(&ureq, udata, sizeof(ureq))) {
if (ureq.comp_mask & BNXT_RE_COMP_MASK_MQP_EX_PATH_MTU_MASK) {

View File

@ -4168,8 +4168,8 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier,
dev_info(rdev_to_dev(rdev), "%s: Event = %s (0x%lx), rdev %s (real_dev %s)\n",
__func__, bnxt_re_netevent(event), event,
rdev ? rdev->netdev ? rdev->netdev->if_dname : "->netdev = NULL" : "= NULL",
(real_dev == netdev) ? "= netdev" : real_dev->if_dname);
rdev ? rdev->netdev ? if_getdname(rdev->netdev) : "->netdev = NULL" : "= NULL",
(real_dev == netdev) ? "= netdev" : if_getdname(real_dev));
if (!test_bit(BNXT_RE_FLAG_IBDEV_REGISTERED, &rdev->flags))
goto exit;

View File

@ -4535,17 +4535,29 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev)
if_setcapabilitiesbit(ifp, IFCAP_TSO | IFCAP_VLAN_HWTSO, 0);
if_setcapabilitiesbit(ifp, IFCAP_HWSTATS | IFCAP_HWRXTSTMP, 0);
if_setcapabilitiesbit(ifp, IFCAP_MEXTPG, 0);
if_setcapabilitiesbit(ifp, IFCAP_TXTLS4 | IFCAP_TXTLS6, 0);
#ifdef KERN_TLS
if (MLX5_CAP_GEN(mdev, tls_tx) != 0 &&
MLX5_CAP_GEN(mdev, log_max_dek) != 0)
if_setcapabilitiesbit(ifp, IFCAP_TXTLS4 | IFCAP_TXTLS6, 0);
if (MLX5_CAP_GEN(mdev, tls_rx) != 0 &&
MLX5_CAP_GEN(mdev, log_max_dek) != 0 &&
MLX5_CAP_FLOWTABLE_NIC_RX(mdev,
ft_field_support.outer_ip_version) != 0)
if_setcapabilities2bit(ifp, IFCAP2_BIT(IFCAP2_RXTLS4) |
IFCAP2_BIT(IFCAP2_RXTLS6), 0);
#endif
#ifdef RATELIMIT
if_setcapabilitiesbit(ifp, IFCAP_TXRTLMT | IFCAP_TXTLS_RTLMT, 0);
if (MLX5_CAP_GEN(mdev, qos) &&
MLX5_CAP_QOS(mdev, packet_pacing))
if_setcapabilitiesbit(ifp, IFCAP_TXRTLMT | IFCAP_TXTLS_RTLMT,
0);
#endif
if_setcapabilitiesbit(ifp, IFCAP_VXLAN_HWCSUM | IFCAP_VXLAN_HWTSO, 0);
if_setcapabilities2bit(ifp, IFCAP2_BIT(IFCAP2_RXTLS4) |
IFCAP2_BIT(IFCAP2_RXTLS6), 0);
#ifdef IPSEC_OFFLOAD
if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_PACKET_OFFLOAD)
if_setcapabilities2bit(ifp, IFCAP2_BIT(IFCAP2_IPSEC_OFFLOAD),
0);
#endif
if_setsndtagallocfn(ifp, mlx5e_snd_tag_alloc);
#ifdef RATELIMIT

View File

@ -2624,6 +2624,7 @@ static int
qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data)
{
int ret = 0, mask;
int flags;
struct ifreq *ifr = (struct ifreq *)data;
#ifdef INET
struct ifaddr *ifa = (struct ifaddr *)data;
@ -2677,15 +2678,16 @@ qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data)
QL_DPRINT4(ha, "SIOCSIFFLAGS (0x%lx)\n", cmd);
QLNX_LOCK(ha);
flags = if_getflags(ifp);
if (if_getflags(ifp) & IFF_UP) {
if (flags & IFF_UP) {
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
if ((if_getflags(ifp) ^ ha->if_flags) &
if ((flags ^ ha->if_flags) &
IFF_PROMISC) {
ret = qlnx_set_promisc(ha, ifp->if_flags & IFF_PROMISC);
ret = qlnx_set_promisc(ha, flags & IFF_PROMISC);
} else if ((if_getflags(ifp) ^ ha->if_flags) &
IFF_ALLMULTI) {
ret = qlnx_set_allmulti(ha, ifp->if_flags & IFF_ALLMULTI);
ret = qlnx_set_allmulti(ha, flags & IFF_ALLMULTI);
}
} else {
ha->max_frame_size = if_getmtu(ifp) +
@ -7057,12 +7059,14 @@ qlnx_set_rx_mode(qlnx_host_t *ha)
{
int rc = 0;
uint8_t filter;
const struct ifnet *ifp = ha->ifp;
const if_t ifp = ha->ifp;
const struct ifaddr *ifa;
struct sockaddr_dl *sdl;
if (ifp->if_type == IFT_ETHER && ifp->if_addr != NULL &&
ifp->if_addr->ifa_addr != NULL) {
sdl = (struct sockaddr_dl *) ifp->if_addr->ifa_addr;
ifa = if_getifaddr(ifp);
if (if_gettype(ifp) == IFT_ETHER && ifa != NULL &&
ifa->ifa_addr != NULL) {
sdl = (struct sockaddr_dl *) ifa->ifa_addr;
rc = qlnx_set_ucast_rx_mac(ha, ECORE_FILTER_REPLACE, LLADDR(sdl));
} else {
@ -7079,10 +7083,10 @@ qlnx_set_rx_mode(qlnx_host_t *ha)
ECORE_ACCEPT_MCAST_MATCHED |
ECORE_ACCEPT_BCAST;
if (qlnx_vf_device(ha) == 0 || (ha->ifp->if_flags & IFF_PROMISC)) {
if (qlnx_vf_device(ha) == 0 || (if_getflags(ha->ifp) & IFF_PROMISC)) {
filter |= ECORE_ACCEPT_UCAST_UNMATCHED;
filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
} else if (ha->ifp->if_flags & IFF_ALLMULTI) {
} else if (if_getflags(ha->ifp) & IFF_ALLMULTI) {
filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
}
ha->filter = filter;

View File

@ -1222,7 +1222,7 @@ g_mirror_start(struct bio *bp)
}
/*
* Return TRUE if the given request is colliding with a in-progress
* Return true if the given request is colliding with a in-progress
* synchronization request.
*/
static bool
@ -1254,7 +1254,7 @@ g_mirror_sync_collision(struct g_mirror_softc *sc, struct bio *bp)
}
/*
* Return TRUE if the given sync request is colliding with a in-progress regular
* Return true if the given sync request is colliding with a in-progress regular
* request.
*/
static bool

View File

@ -2605,11 +2605,9 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags,
*/
if (error == 0) {
error = thread_check_susp(td, false);
if (error == 0) {
if (try != 0)
error = EBUSY;
else
continue;
if (error == 0 && try == 0) {
umtxq_unbusy_unlocked(&uq->uq_key);
continue;
}
error = 0;
}

View File

@ -2304,10 +2304,10 @@ breadn_flags(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size,
int
bufwrite(struct buf *bp)
{
int oldflags;
struct vnode *vp;
long space;
int vp_md;
int oldflags, retval;
bool vp_md;
CTR3(KTR_BUF, "bufwrite(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags);
if ((bp->b_bufobj->bo_flag & BO_DEAD) != 0) {
@ -2316,24 +2316,21 @@ bufwrite(struct buf *bp)
brelse(bp);
return (ENXIO);
}
if (bp->b_flags & B_INVAL) {
if ((bp->b_flags & B_INVAL) != 0) {
brelse(bp);
return (0);
}
if (bp->b_flags & B_BARRIER)
if ((bp->b_flags & B_BARRIER) != 0)
atomic_add_long(&barrierwrites, 1);
oldflags = bp->b_flags;
KASSERT(!(bp->b_vflags & BV_BKGRDINPROG),
KASSERT((bp->b_vflags & BV_BKGRDINPROG) == 0,
("FFS background buffer should not get here %p", bp));
vp = bp->b_vp;
if (vp)
vp_md = vp->v_vflag & VV_MD;
else
vp_md = 0;
vp_md = vp != NULL && (vp->v_vflag & VV_MD) != 0;
/*
* Mark the buffer clean. Increment the bufobj write count
@ -2365,24 +2362,22 @@ bufwrite(struct buf *bp)
}
#endif /* RACCT */
curthread->td_ru.ru_oublock++;
if (oldflags & B_ASYNC)
if ((oldflags & B_ASYNC) != 0)
BUF_KERNPROC(bp);
bp->b_iooffset = dbtob(bp->b_blkno);
buf_track(bp, __func__);
bstrategy(bp);
if ((oldflags & B_ASYNC) == 0) {
int rtval = bufwait(bp);
retval = bufwait(bp);
brelse(bp);
return (rtval);
return (retval);
} else if (space > hirunningspace) {
/*
* don't allow the async write to saturate the I/O
* system. We will not deadlock here because
* we are blocking waiting for I/O that is already in-progress
* to complete. We do not block here if it is the update
* or syncer daemon trying to clean up as that can lead
* to deadlock.
* Don't allow the async write to saturate the I/O
* system. We do not block here if it is the update
* or syncer daemon trying to clean up as that can
* lead to deadlock.
*/
if ((curthread->td_pflags & TDP_NORUNNINGBUF) == 0 && !vp_md)
waitrunningbufspace();

View File

@ -1992,25 +1992,11 @@ vn_alloc_hard(struct mount *mp, u_long rnumvnodes, bool bumped)
mtx_lock(&vnode_list_mtx);
if (vn_alloc_cyclecount != 0) {
rnumvnodes = atomic_load_long(&numvnodes);
if (rnumvnodes + 1 < desiredvnodes) {
vn_alloc_cyclecount = 0;
mtx_unlock(&vnode_list_mtx);
goto alloc;
}
rfreevnodes = vnlru_read_freevnodes();
if (rfreevnodes < wantfreevnodes) {
if (vn_alloc_cyclecount++ >= rfreevnodes) {
vn_alloc_cyclecount = 0;
vstir = true;
}
} else {
vn_alloc_cyclecount = 0;
}
rfreevnodes = vnlru_read_freevnodes();
if (vn_alloc_cyclecount++ >= rfreevnodes) {
vn_alloc_cyclecount = 0;
vstir = true;
}
/*
* Grow the vnode cache if it will not be above its target max after
* growing. Otherwise, if there is at least one free vnode, try to

View File

@ -37,6 +37,7 @@
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_private.h>
#include <net/vnet.h>
#include <net/pfil.h>

View File

@ -753,7 +753,6 @@ int ether_poll_deregister(if_t ifp);
#endif /* _KERNEL */
#include <net/if_private.h> /* XXX: temporary until drivers converted. */
#include <net/ifq.h> /* XXXAO: temporary unconditional include */
#endif /* !_NET_IF_VAR_H_ */

View File

@ -772,12 +772,15 @@ add_route_byinfo(struct rib_head *rnh, struct rt_addrinfo *info,
rnd_add.rnd_weight = get_info_weight(info, RT_DEFAULT_WEIGHT);
int op_flags = RTM_F_CREATE;
if (get_prio_from_info(info) == NH_PRIORITY_HIGH)
op_flags |= RTM_F_FORCE;
else
op_flags |= RTM_F_APPEND;
return (add_route_flags(rnh, rt, &rnd_add, op_flags, rc));
/*
* Set the desired action when the route already exists:
* If RTF_PINNED is present, assume the direct kernel routes that cannot be multipath.
* Otherwise, append the path.
*/
op_flags |= (info->rti_flags & RTF_PINNED) ? RTM_F_REPLACE : RTM_F_APPEND;
return (add_route_flags(rnh, rt, &rnd_add, op_flags, rc));
}
static int

View File

@ -61,11 +61,11 @@ int rib_del_route_px_gw(uint32_t fibnum, struct sockaddr *dst, int plen,
const struct sockaddr *gw, int op_flags, struct rib_cmd_info *rc);
/* operation flags */
#define RTM_F_CREATE 0x01
#define RTM_F_EXCL 0x02
#define RTM_F_REPLACE 0x04
#define RTM_F_APPEND 0x08
#define RTM_F_FORCE 0x10
#define RTM_F_CREATE 0x01 /* Create object if not exists */
#define RTM_F_EXCL 0x02 /* (Deprecated) Do not replace or append if exists */
#define RTM_F_REPLACE 0x04 /* Replace if route (even multipath) if exists */
#define RTM_F_APPEND 0x08 /* Append path to the route */
#define RTM_F_FORCE 0x10 /* Bump operation priority to highest */
int rib_add_route(uint32_t fibnum, struct rt_addrinfo *info,
struct rib_cmd_info *rc);

View File

@ -39,6 +39,7 @@
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_private.h>
#include <net/ethernet.h>
#include <net/bpf.h>
#include <net/vnet.h>

View File

@ -44,6 +44,7 @@
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_private.h>
#include <net/vnet.h>
#include <netinet/in.h>
#include <netinet/ip.h>

View File

@ -322,11 +322,13 @@ dump_iface(struct nl_writer *nw, if_t ifp, const struct nlmsghdr *hdr,
*/
if (if_getaddrlen(ifp) != 0) {
struct ifaddr *ifa;
struct ifa_iter it;
NET_EPOCH_ENTER(et);
ifa = CK_STAILQ_FIRST(&ifp->if_addrhead);
ifa = ifa_iter_start(ifp, &it);
if (ifa != NULL)
dump_sa(nw, IFLA_ADDRESS, ifa->ifa_addr);
ifa_iter_finish(&it);
NET_EPOCH_EXIT(et);
}

View File

@ -126,6 +126,14 @@ SDT_PROBE_DEFINE5(pf, ip, state, lookup, "struct pfi_kkif *",
"struct pf_kstate *");
SDT_PROBE_DEFINE2(pf, ip, , bound_iface, "struct pf_kstate *",
"struct pfi_kkif *");
SDT_PROBE_DEFINE4(pf, ip, route_to, entry, "struct mbuf *",
"struct pf_pdesc *", "struct pf_kstate *", "struct ifnet *");
SDT_PROBE_DEFINE1(pf, ip, route_to, drop, "int");
SDT_PROBE_DEFINE2(pf, ip, route_to, output, "struct ifnet *", "int");
SDT_PROBE_DEFINE4(pf, ip6, route_to, entry, "struct mbuf *",
"struct pf_pdesc *", "struct pf_kstate *", "struct ifnet *");
SDT_PROBE_DEFINE1(pf, ip6, route_to, drop, "int");
SDT_PROBE_DEFINE2(pf, ip6, route_to, output, "struct ifnet *", "int");
SDT_PROBE_DEFINE4(pf, sctp, multihome, test, "struct pfi_kkif *",
"struct pf_krule *", "struct mbuf *", "int");
SDT_PROBE_DEFINE2(pf, sctp, multihome, add, "uint32_t",
@ -7660,6 +7668,8 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
KASSERT(m && *m && r && oifp, ("%s: invalid parameters", __func__));
SDT_PROBE4(pf, ip, route_to, entry, *m, pd, s, oifp);
if (s) {
r_rt = s->rt;
r_dir = s->direction;
@ -7677,6 +7687,7 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
pd->pf_mtag->routed++ > 3) {
m0 = *m;
*m = NULL;
SDT_PROBE1(pf, ip, route_to, drop, __LINE__);
goto bad_locked;
}
@ -7699,6 +7710,7 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
} else {
m0 = *m;
*m = NULL;
SDT_PROBE1(pf, ip, route_to, drop, __LINE__);
goto bad;
}
} else {
@ -7732,6 +7744,7 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
if (TAILQ_EMPTY(&r->rpool.list)) {
DPFPRINTF(PF_DEBUG_URGENT,
("%s: TAILQ_EMPTY(&r->rpool.list)\n", __func__));
SDT_PROBE1(pf, ip, route_to, drop, __LINE__);
goto bad_locked;
}
pf_map_addr(AF_INET, r, (struct pf_addr *)&ip->ip_src,
@ -7764,18 +7777,24 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
PF_STATE_UNLOCK(s);
}
if (ifp == NULL)
if (ifp == NULL) {
SDT_PROBE1(pf, ip, route_to, drop, __LINE__);
goto bad;
}
if (pd->dir == PF_IN) {
if (pf_test(AF_INET, PF_OUT, PFIL_FWD, ifp, &m0, inp,
&pd->act) != PF_PASS)
&pd->act) != PF_PASS) {
SDT_PROBE1(pf, ip, route_to, drop, __LINE__);
goto bad;
else if (m0 == NULL)
} else if (m0 == NULL) {
SDT_PROBE1(pf, ip, route_to, drop, __LINE__);
goto done;
}
if (m0->m_len < sizeof(struct ip)) {
DPFPRINTF(PF_DEBUG_URGENT,
("%s: m0->m_len < sizeof(struct ip)\n", __func__));
SDT_PROBE1(pf, ip, route_to, drop, __LINE__);
goto bad;
}
ip = mtod(m0, struct ip *);
@ -7834,8 +7853,10 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
md = m0;
error = pf_dummynet_route(pd, s, r, ifp, sintosa(&dst), &md);
if (md != NULL)
if (md != NULL) {
error = (*ifp->if_output)(ifp, md, sintosa(&dst), NULL);
SDT_PROBE2(pf, ip, route_to, output, ifp, error);
}
goto done;
}
@ -7851,14 +7872,19 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
icmp_error(m0, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, 0,
ifp->if_mtu);
SDT_PROBE1(pf, ip, route_to, drop, __LINE__);
goto done;
} else
} else {
SDT_PROBE1(pf, ip, route_to, drop, __LINE__);
goto bad;
}
}
error = ip_fragment(ip, &m0, ifp->if_mtu, ifp->if_hwassist);
if (error)
if (error) {
SDT_PROBE1(pf, ip, route_to, drop, __LINE__);
goto bad;
}
for (; m0; m0 = m1) {
m1 = m0->m_nextpkt;
@ -7869,9 +7895,11 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
pd->pf_mtag = pf_find_mtag(md);
error = pf_dummynet_route(pd, s, r, ifp,
sintosa(&dst), &md);
if (md != NULL)
if (md != NULL) {
error = (*ifp->if_output)(ifp, md,
sintosa(&dst), NULL);
SDT_PROBE2(pf, ip, route_to, output, ifp, error);
}
} else
m_freem(m0);
}
@ -7908,6 +7936,8 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
KASSERT(m && *m && r && oifp, ("%s: invalid parameters", __func__));
SDT_PROBE4(pf, ip6, route_to, entry, *m, pd, s, oifp);
if (s) {
r_rt = s->rt;
r_dir = s->direction;
@ -7925,6 +7955,7 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
pd->pf_mtag->routed++ > 3) {
m0 = *m;
*m = NULL;
SDT_PROBE1(pf, ip6, route_to, drop, __LINE__);
goto bad_locked;
}
@ -7947,6 +7978,7 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
} else {
m0 = *m;
*m = NULL;
SDT_PROBE1(pf, ip6, route_to, drop, __LINE__);
goto bad;
}
} else {
@ -7980,6 +8012,7 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
if (TAILQ_EMPTY(&r->rpool.list)) {
DPFPRINTF(PF_DEBUG_URGENT,
("%s: TAILQ_EMPTY(&r->rpool.list)\n", __func__));
SDT_PROBE1(pf, ip6, route_to, drop, __LINE__);
goto bad_locked;
}
pf_map_addr(AF_INET6, r, (struct pf_addr *)&ip6->ip6_src,
@ -8014,19 +8047,25 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
if (s)
PF_STATE_UNLOCK(s);
if (ifp == NULL)
if (ifp == NULL) {
SDT_PROBE1(pf, ip6, route_to, drop, __LINE__);
goto bad;
}
if (pd->dir == PF_IN) {
if (pf_test(AF_INET6, PF_OUT, PFIL_FWD, ifp, &m0, inp,
&pd->act) != PF_PASS)
&pd->act) != PF_PASS) {
SDT_PROBE1(pf, ip6, route_to, drop, __LINE__);
goto bad;
else if (m0 == NULL)
} else if (m0 == NULL) {
SDT_PROBE1(pf, ip6, route_to, drop, __LINE__);
goto done;
}
if (m0->m_len < sizeof(struct ip6_hdr)) {
DPFPRINTF(PF_DEBUG_URGENT,
("%s: m0->m_len < sizeof(struct ip6_hdr)\n",
__func__));
SDT_PROBE1(pf, ip6, route_to, drop, __LINE__);
goto bad;
}
ip6 = mtod(m0, struct ip6_hdr *);
@ -8051,8 +8090,11 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
if ((u_long)m0->m_pkthdr.len <= ifp->if_mtu) {
md = m0;
pf_dummynet_route(pd, s, r, ifp, sintosa(&dst), &md);
if (md != NULL)
nd6_output_ifp(ifp, ifp, md, &dst, NULL);
if (md != NULL) {
int ret;
ret = nd6_output_ifp(ifp, ifp, md, &dst, NULL);
SDT_PROBE2(pf, ip6, route_to, output, ifp, ret);
}
}
else {
in6_ifstat_inc(ifp, ifs6_in_toobig);
@ -8063,8 +8105,11 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp,
sizeof(struct ip6_hdr), s);
icmp6_error(m0, ICMP6_PACKET_TOO_BIG, 0, ifp->if_mtu);
} else
SDT_PROBE1(pf, ip6, route_to, drop, __LINE__);
} else {
SDT_PROBE1(pf, ip6, route_to, drop, __LINE__);
goto bad;
}
}
done:

View File

@ -3630,6 +3630,7 @@ softdep_process_journal(struct mount *mp,
int cnt;
int off;
int devbsize;
int savef;
ump = VFSTOUFS(mp);
if (ump->um_softdep == NULL || ump->um_softdep->sd_jblocks == NULL)
@ -3641,6 +3642,8 @@ softdep_process_journal(struct mount *mp,
fs = ump->um_fs;
jblocks = ump->softdep_jblocks;
devbsize = ump->um_devvp->v_bufobj.bo_bsize;
savef = curthread_pflags_set(TDP_NORUNNINGBUF);
/*
* We write anywhere between a disk block and fs block. The upper
* bound is picked to prevent buffer cache fragmentation and limit
@ -3859,12 +3862,15 @@ softdep_process_journal(struct mount *mp,
*/
if (flags == 0 && jblocks->jb_suspended) {
if (journal_unsuspend(ump))
return;
goto out;
FREE_LOCK(ump);
VFS_SYNC(mp, MNT_NOWAIT);
ffs_sbupdate(ump, MNT_WAIT, 0);
ACQUIRE_LOCK(ump);
}
out:
curthread_pflags_restore(savef);
}
/*

View File

@ -859,6 +859,166 @@ WIDTH
<HANGUL_CHOSEONG_NIEUN-HIEUH> 2
<HANGUL_CHOSEONG_TIKEUT-RIEUL> 2
<HANGUL_CHOSEONG_FILLER> 2
<HANGUL_JUNGSEONG_FILLER> 0
<HANGUL_JUNGSEONG_A> 0
<HANGUL_JUNGSEONG_AE> 0
<HANGUL_JUNGSEONG_YA> 0
<HANGUL_JUNGSEONG_YAE> 0
<HANGUL_JUNGSEONG_EO> 0
<HANGUL_JUNGSEONG_E> 0
<HANGUL_JUNGSEONG_YEO> 0
<HANGUL_JUNGSEONG_YE> 0
<HANGUL_JUNGSEONG_O> 0
<HANGUL_JUNGSEONG_WA> 0
<HANGUL_JUNGSEONG_WAE> 0
<HANGUL_JUNGSEONG_OE> 0
<HANGUL_JUNGSEONG_YO> 0
<HANGUL_JUNGSEONG_U> 0
<HANGUL_JUNGSEONG_WEO> 0
<HANGUL_JUNGSEONG_WE> 0
<HANGUL_JUNGSEONG_WI> 0
<HANGUL_JUNGSEONG_YU> 0
<HANGUL_JUNGSEONG_EU> 0
<HANGUL_JUNGSEONG_YI> 0
<HANGUL_JUNGSEONG_I> 0
<HANGUL_JUNGSEONG_A-O> 0
<HANGUL_JUNGSEONG_A-U> 0
<HANGUL_JUNGSEONG_YA-O> 0
<HANGUL_JUNGSEONG_YA-YO> 0
<HANGUL_JUNGSEONG_EO-O> 0
<HANGUL_JUNGSEONG_EO-U> 0
<HANGUL_JUNGSEONG_EO-EU> 0
<HANGUL_JUNGSEONG_YEO-O> 0
<HANGUL_JUNGSEONG_YEO-U> 0
<HANGUL_JUNGSEONG_O-EO> 0
<HANGUL_JUNGSEONG_O-E> 0
<HANGUL_JUNGSEONG_O-YE> 0
<HANGUL_JUNGSEONG_O-O> 0
<HANGUL_JUNGSEONG_O-U> 0
<HANGUL_JUNGSEONG_YO-YA> 0
<HANGUL_JUNGSEONG_YO-YAE> 0
<HANGUL_JUNGSEONG_YO-YEO> 0
<HANGUL_JUNGSEONG_YO-O> 0
<HANGUL_JUNGSEONG_YO-I> 0
<HANGUL_JUNGSEONG_U-A> 0
<HANGUL_JUNGSEONG_U-AE> 0
<HANGUL_JUNGSEONG_U-EO-EU> 0
<HANGUL_JUNGSEONG_U-YE> 0
<HANGUL_JUNGSEONG_U-U> 0
<HANGUL_JUNGSEONG_YU-A> 0
<HANGUL_JUNGSEONG_YU-EO> 0
<HANGUL_JUNGSEONG_YU-E> 0
<HANGUL_JUNGSEONG_YU-YEO> 0
<HANGUL_JUNGSEONG_YU-YE> 0
<HANGUL_JUNGSEONG_YU-U> 0
<HANGUL_JUNGSEONG_YU-I> 0
<HANGUL_JUNGSEONG_EU-U> 0
<HANGUL_JUNGSEONG_EU-EU> 0
<HANGUL_JUNGSEONG_YI-U> 0
<HANGUL_JUNGSEONG_I-A> 0
<HANGUL_JUNGSEONG_I-YA> 0
<HANGUL_JUNGSEONG_I-O> 0
<HANGUL_JUNGSEONG_I-U> 0
<HANGUL_JUNGSEONG_I-EU> 0
<HANGUL_JUNGSEONG_I-ARAEA> 0
<HANGUL_JUNGSEONG_ARAEA> 0
<HANGUL_JUNGSEONG_ARAEA-EO> 0
<HANGUL_JUNGSEONG_ARAEA-U> 0
<HANGUL_JUNGSEONG_ARAEA-I> 0
<HANGUL_JUNGSEONG_SSANGARAEA> 0
<HANGUL_JUNGSEONG_A-EU> 0
<HANGUL_JUNGSEONG_YA-U> 0
<HANGUL_JUNGSEONG_YEO-YA> 0
<HANGUL_JUNGSEONG_O-YA> 0
<HANGUL_JUNGSEONG_O-YAE> 0
<HANGUL_JONGSEONG_KIYEOK> 0
<HANGUL_JONGSEONG_SSANGKIYEOK> 0
<HANGUL_JONGSEONG_KIYEOK-SIOS> 0
<HANGUL_JONGSEONG_NIEUN> 0
<HANGUL_JONGSEONG_NIEUN-CIEUC> 0
<HANGUL_JONGSEONG_NIEUN-HIEUH> 0
<HANGUL_JONGSEONG_TIKEUT> 0
<HANGUL_JONGSEONG_RIEUL> 0
<HANGUL_JONGSEONG_RIEUL-KIYEOK> 0
<HANGUL_JONGSEONG_RIEUL-MIEUM> 0
<HANGUL_JONGSEONG_RIEUL-PIEUP> 0
<HANGUL_JONGSEONG_RIEUL-SIOS> 0
<HANGUL_JONGSEONG_RIEUL-THIEUTH> 0
<HANGUL_JONGSEONG_RIEUL-PHIEUPH> 0
<HANGUL_JONGSEONG_RIEUL-HIEUH> 0
<HANGUL_JONGSEONG_MIEUM> 0
<HANGUL_JONGSEONG_PIEUP> 0
<HANGUL_JONGSEONG_PIEUP-SIOS> 0
<HANGUL_JONGSEONG_SIOS> 0
<HANGUL_JONGSEONG_SSANGSIOS> 0
<HANGUL_JONGSEONG_IEUNG> 0
<HANGUL_JONGSEONG_CIEUC> 0
<HANGUL_JONGSEONG_CHIEUCH> 0
<HANGUL_JONGSEONG_KHIEUKH> 0
<HANGUL_JONGSEONG_THIEUTH> 0
<HANGUL_JONGSEONG_PHIEUPH> 0
<HANGUL_JONGSEONG_HIEUH> 0
<HANGUL_JONGSEONG_KIYEOK-RIEUL> 0
<HANGUL_JONGSEONG_KIYEOK-SIOS-KIYEOK> 0
<HANGUL_JONGSEONG_NIEUN-KIYEOK> 0
<HANGUL_JONGSEONG_NIEUN-TIKEUT> 0
<HANGUL_JONGSEONG_NIEUN-SIOS> 0
<HANGUL_JONGSEONG_NIEUN-PANSIOS> 0
<HANGUL_JONGSEONG_NIEUN-THIEUTH> 0
<HANGUL_JONGSEONG_TIKEUT-KIYEOK> 0
<HANGUL_JONGSEONG_TIKEUT-RIEUL> 0
<HANGUL_JONGSEONG_RIEUL-KIYEOK-SIOS> 0
<HANGUL_JONGSEONG_RIEUL-NIEUN> 0
<HANGUL_JONGSEONG_RIEUL-TIKEUT> 0
<HANGUL_JONGSEONG_RIEUL-TIKEUT-HIEUH> 0
<HANGUL_JONGSEONG_SSANGRIEUL> 0
<HANGUL_JONGSEONG_RIEUL-MIEUM-KIYEOK> 0
<HANGUL_JONGSEONG_RIEUL-MIEUM-SIOS> 0
<HANGUL_JONGSEONG_RIEUL-PIEUP-SIOS> 0
<HANGUL_JONGSEONG_RIEUL-PIEUP-HIEUH> 0
<HANGUL_JONGSEONG_RIEUL-KAPYEOUNPIEUP> 0
<HANGUL_JONGSEONG_RIEUL-SSANGSIOS> 0
<HANGUL_JONGSEONG_RIEUL-PANSIOS> 0
<HANGUL_JONGSEONG_RIEUL-KHIEUKH> 0
<HANGUL_JONGSEONG_RIEUL-YEORINHIEUH> 0
<HANGUL_JONGSEONG_MIEUM-KIYEOK> 0
<HANGUL_JONGSEONG_MIEUM-RIEUL> 0
<HANGUL_JONGSEONG_MIEUM-PIEUP> 0
<HANGUL_JONGSEONG_MIEUM-SIOS> 0
<HANGUL_JONGSEONG_MIEUM-SSANGSIOS> 0
<HANGUL_JONGSEONG_MIEUM-PANSIOS> 0
<HANGUL_JONGSEONG_MIEUM-CHIEUCH> 0
<HANGUL_JONGSEONG_MIEUM-HIEUH> 0
<HANGUL_JONGSEONG_KAPYEOUNMIEUM> 0
<HANGUL_JONGSEONG_PIEUP-RIEUL> 0
<HANGUL_JONGSEONG_PIEUP-PHIEUPH> 0
<HANGUL_JONGSEONG_PIEUP-HIEUH> 0
<HANGUL_JONGSEONG_KAPYEOUNPIEUP> 0
<HANGUL_JONGSEONG_SIOS-KIYEOK> 0
<HANGUL_JONGSEONG_SIOS-TIKEUT> 0
<HANGUL_JONGSEONG_SIOS-RIEUL> 0
<HANGUL_JONGSEONG_SIOS-PIEUP> 0
<HANGUL_JONGSEONG_PANSIOS> 0
<HANGUL_JONGSEONG_IEUNG-KIYEOK> 0
<HANGUL_JONGSEONG_IEUNG-SSANGKIYEOK> 0
<HANGUL_JONGSEONG_SSANGIEUNG> 0
<HANGUL_JONGSEONG_IEUNG-KHIEUKH> 0
<HANGUL_JONGSEONG_YESIEUNG> 0
<HANGUL_JONGSEONG_YESIEUNG-SIOS> 0
<HANGUL_JONGSEONG_YESIEUNG-PANSIOS> 0
<HANGUL_JONGSEONG_PHIEUPH-PIEUP> 0
<HANGUL_JONGSEONG_KAPYEOUNPHIEUPH> 0
<HANGUL_JONGSEONG_HIEUH-NIEUN> 0
<HANGUL_JONGSEONG_HIEUH-RIEUL> 0
<HANGUL_JONGSEONG_HIEUH-MIEUM> 0
<HANGUL_JONGSEONG_HIEUH-PIEUP> 0
<HANGUL_JONGSEONG_YEORINHIEUH> 0
<HANGUL_JONGSEONG_KIYEOK-NIEUN> 0
<HANGUL_JONGSEONG_KIYEOK-PIEUP> 0
<HANGUL_JONGSEONG_KIYEOK-CHIEUCH> 0
<HANGUL_JONGSEONG_KIYEOK-KHIEUKH> 0
<HANGUL_JONGSEONG_KIYEOK-HIEUH> 0
<HANGUL_JONGSEONG_SSANGNIEUN> 0
<ETHIOPIC_COMBINING_GEMINATION_AND_VOWEL_LENGTH_MARK> 0
<ETHIOPIC_COMBINING_VOWEL_LENGTH_MARK> 0
<ETHIOPIC_COMBINING_GEMINATION_MARK> 0

View File

@ -28,6 +28,21 @@
#include <utf8proc.h>
static int
width_of(int32_t wc)
{
/*
* Hangul Jamo medial vowels and final consonants are more of
* a combining character, and should be considered zero-width.
*/
if (wc >= 0x1160 && wc <= 0x11ff)
return (0);
/* No override by default, trust utf8proc's width. */
return (utf8proc_charwidth(wc));
}
int
main(void)
{
@ -43,9 +58,10 @@ main(void)
wcc = utf8proc_category(wc);
if (wcc == UTF8PROC_CATEGORY_CC)
continue;
wcw = utf8proc_charwidth(wc);
wcw = width_of(wc);
if (wcw == 1)
continue;
printf("%04X %d\n", wc, wcw);
}