From: Dan Carpenter <dan.carpenter@oracle.com>
To: Sven Eckelmann <sven@narfation.org>
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] question about frag_can_reassemble()
Date: Fri, 30 Mar 2012 23:02:37 +0300 [thread overview]
Message-ID: <20120330200236.GH3289@mwanda> (raw)
Hi Sven,
I had a question about the code in frag_can_reassemble().
net/batman-adv/unicast.h
51
52 merged_size = (skb->len - sizeof(*unicast_packet)) * 2;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53 merged_size += sizeof(struct unicast_packet) + uneven_correction;
54
55 return merged_size <= mtu;
56 }
Can the skb->len be less than sizeof(*unicast_packet) (ie 20 bytes)?
If "len" is less than 10 then we would return false but if it's
over 10 then we would return true. Roughly.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Sven Eckelmann <sven-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org
Subject: question about frag_can_reassemble()
Date: Fri, 30 Mar 2012 23:02:37 +0300 [thread overview]
Message-ID: <20120330200236.GH3289@mwanda> (raw)
Hi Sven,
I had a question about the code in frag_can_reassemble().
net/batman-adv/unicast.h
51
52 merged_size = (skb->len - sizeof(*unicast_packet)) * 2;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53 merged_size += sizeof(struct unicast_packet) + uneven_correction;
54
55 return merged_size <= mtu;
56 }
Can the skb->len be less than sizeof(*unicast_packet) (ie 20 bytes)?
If "len" is less than 10 then we would return false but if it's
over 10 then we would return true. Roughly.
regards,
dan carpenter
next reply other threads:[~2012-03-30 20:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 20:02 Dan Carpenter [this message]
2012-03-30 20:02 ` question about frag_can_reassemble() Dan Carpenter
2012-03-31 8:52 ` [B.A.T.M.A.N.] " Marek Lindner
2012-03-31 8:52 ` Marek Lindner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120330200236.GH3289@mwanda \
--to=dan.carpenter@oracle.com \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=netdev@vger.kernel.org \
--cc=sven@narfation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.