netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] cipso: cleanup cipso_v4_translate() when !CONFIG_NETLABEL
@ 2013-12-10 20:00 Paul Moore
  2013-12-10 22:57 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Moore @ 2013-12-10 20:00 UTC (permalink / raw)
  To: netdev

Don't needlessly recompute 'opt[opt_iter + 1]' as we already have it
stored in 'tag_len'.

Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 include/net/cipso_ipv4.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index a8c2ef6..2244e02 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -304,7 +304,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb,
 
 	for (opt_iter = 6; opt_iter < opt_len;) {
 		tag_len = opt[opt_iter + 1];
-		if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) {
+		if ((tag_len == 0) || (tag_len > (opt_len - opt_iter))) {
 			err_offset = opt_iter + 1;
 			goto out;
 		}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-10 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 20:00 [PATCH v2] cipso: cleanup cipso_v4_translate() when !CONFIG_NETLABEL Paul Moore
2013-12-10 22:57 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).