Skip to contentSkip to conversation

cipso: cleanup cipso_v4_translate() when !CONFIG_NETLABEL

PATCH Applied Paul Moore 2 participants 2 messages Dec 10, 2013

Subsystems (3)
lore
Share & tools
lore

Paul Moore

author
#0 lore raw

PATCH v2 1/1 cipso: cleanup cipso_v4_translate() when !CONFIG_NETLABEL

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

---
 include/net/cipso_ipv4.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/cipso_ipv4.h +1 -1
index a8c2ef6..2244e02 100644
@@ -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;
 		}