Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Aug 2022 14:39:29 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 265718] ip_fragment() does not call IPSTAT() in one error case
Message-ID:  <bug-265718-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265718

            Bug ID: 265718
           Summary: ip_fragment() does not call IPSTAT() in one error case
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: rozhuk.im@gmail.com

sys/netinet/ip_output.c

...
int
ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu,
    u_long if_hwassist_flags)
{
        int error =3D 0;
        int hlen =3D ip->ip_hl << 2;
        int len =3D (mtu - hlen) & ~7;    /* size of payload in each fragme=
nt */
        int off;
        struct mbuf *m0 =3D *m_frag;      /* the original packet          */
        int firstlen;
        struct mbuf **mnext;
        int nfrags;
        uint16_t ip_len, ip_off;

        ip_len =3D ntohs(ip->ip_len);
        ip_off =3D ntohs(ip->ip_off);

        if (ip_off & IP_DF) {   /* Fragmentation not allowed */
                IPSTAT_INC(ips_cantfrag);
                return EMSGSIZE;
        }

        /*
         * Must be able to put at least 8 bytes per fragment.
         */
        if (len < 8)
                return EMSGSIZE;

...

In all other error cases IPSTAT_INC() called before exit.
Without this stat more time required to debug.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-265718-227>