From: Brandon Craig Rhodes <brandon@rhodesmill.org>
To: Mitchell Blank Jr <mitch@sfgoth.com>
Cc: netdev@vger.kernel.org
Subject: Re: TKIP encryption should allocate enough tailroom
Date: Tue, 16 Jan 2007 22:34:43 -0500 [thread overview]
Message-ID: <877ivm72cs.fsf@ten22.rhodesmill.org> (raw)
In-Reply-To: <20070117033931.GX35756@gaz.sfgoth.com> (Mitchell Blank, Jr.'s message of "Tue, 16 Jan 2007 19:39:31 -0800")
Mitchell Blank Jr <mitch@sfgoth.com> writes:
> Brandon Craig Rhodes wrote:
>
>> + if (unlikely(err || skb_tailroom(skb) < 4)) {
>> + printk(KERN_DEBUG "Failed to increase tailroom"
>> + " for TKIP encrypt");
>> + return err || -1;
>
> The "||" operator in C doesn't act the same way it does in perl and ruby.
> You're always returning 1 here.
Egads! You are correct.
My intention was to preserve the value of "err" if an unsuccessful
value was returned by skb_padto(), and otherwise to return "-1" which
seemed the popular value used for errors elsewhere in the code.
- Would the expression "err ? err : -1" have served me better?
- Do error codes mean anything here, or should I simply say "return -1"?
--
Brandon Craig Rhodes brandon@rhodesmill.org http://rhodesmill.org/brandon
next prev parent reply other threads:[~2007-01-17 3:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-17 2:31 TKIP encryption should allocate enough tailroom Brandon Craig Rhodes
2007-01-17 3:39 ` Mitchell Blank Jr
2007-01-17 3:34 ` Brandon Craig Rhodes [this message]
2007-01-17 6:34 ` Herbert Xu
2007-01-17 7:18 ` Herbert Xu
2007-01-17 3:50 ` Michael Wu
2007-01-17 16:46 ` Brandon Craig Rhodes
2007-01-17 17:23 ` Larry Finger
2007-01-17 17:38 ` Brandon Craig Rhodes
2007-01-18 13:16 ` Pekka Pietikainen
2007-01-18 13:55 ` Brandon Craig Rhodes
2007-01-19 12:23 ` Pekka Pietikainen
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=877ivm72cs.fsf@ten22.rhodesmill.org \
--to=brandon@rhodesmill.org \
--cc=mitch@sfgoth.com \
--cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox