diff mbox

[v2] cipso: cleanup cipso_v4_translate() when !CONFIG_NETLABEL

Message ID 20131210200050.5847.32493.stgit@localhost
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Paul Moore Dec. 10, 2013, 8 p.m. UTC
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(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Dec. 10, 2013, 10:57 p.m. UTC | #1
From: Paul Moore <pmoore@redhat.com>
Date: Tue, 10 Dec 2013 15:00:50 -0500

> 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>

Applied, thanks Paul.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 		}