Skip to contentSkip to conversation

Labeled networking fixes for 2.6.28

GIT PULL New Paul Moore 2 participants 5 messages Oct 30, 2008 – Oct 31, 2008

Subsystems (3)
lore
Share & tools
lore

Paul Moore

author
#0 lore raw

Three small fixes to solve compiler warnings and a possible run-time issue, please pull from the following tree:

git://git.infradead.org/users/pcmoore/lblnet-2.6

Thanks.

---

Manish Katiyar (1):
netlabel: Fix compilation warnings in net/netlabel/netlabel_addrlist.c

Paul Moore (1):
netlabel: Fix compiler warnings in netlabel_mgmt.c

roel kluin (1):
cipso: unsigned buf_len cannot be negative

 net/ipv4/cipso_ipv4.c            |    7 ++++---
 net/netlabel/netlabel_addrlist.c |    2 ++
 net/netlabel/netlabel_addrlist.h |   22 ++++++++++++++++++++++
 net/netlabel/netlabel_mgmt.c     |    2 +-
 4 files changed, 29 insertions(+), 4 deletions(-)
author
#1 lore raw

PATCH 1/3 cipso: unsigned buf_len cannot be negative

From: roel kluin <[email protected]>

unsigned buf_len cannot be negative

---

 net/ipv4/cipso_ipv4.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
net/ipv4/cipso_ipv4.c +4 -3
index 490e035..2e78f6b 100644
@@ -2063,9 +2063,10 @@ int cipso_v4_skbuff_setattr(struct sk_buff *skb,
 	u32 opt_len;
 	int len_delta;
 
-	buf_len = cipso_v4_genopt(buf, buf_len, doi_def, secattr);
-	if (buf_len < 0)
-		return buf_len;
+	ret_val = cipso_v4_genopt(buf, buf_len, doi_def, secattr);
+	if (ret_val < 0)
+		return ret_val;
+	buf_len = ret_val;
 	opt_len = (buf_len + 3) & ~3;
 
 	/* we overwrite any existing options to ensure that we have enough
author
#2 lore raw

PATCH 2/3 netlabel: Fix compiler warnings in netlabel_mgmt.c

In reply to Paul Moore

Fix the compiler warnings below, thanks to Andrew Morton for finding them.

net/netlabel/netlabel_mgmt.c: In function `netlbl_mgmt_listentry':
net/netlabel/netlabel_mgmt.c:268: warning: 'ret_val' might be used
uninitialized in this function

---

 net/netlabel/netlabel_mgmt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/netlabel/netlabel_mgmt.c +1 -1
index ee769ec..0a0ef17 100644
@@ -265,7 +265,7 @@ add_failure:
 static int netlbl_mgmt_listentry(struct sk_buff *skb,
 				 struct netlbl_dom_map *entry)
 {
-	int ret_val;
+	int ret_val = 0;
 	struct nlattr *nla_a;
 	struct nlattr *nla_b;
 	struct netlbl_af4list *iter4;
author
#3 lore raw

PATCH 3/3 netlabel: Fix compilation warnings in net/netlabel/netlabel_addrlist.c

In reply to Paul Moore

From: Manish Katiyar <[email protected]>

Enable netlabel auditing functions only when CONFIG_AUDIT is set

---

 net/netlabel/netlabel_addrlist.c |    2 ++
 net/netlabel/netlabel_addrlist.h |   22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
net/netlabel/netlabel_addrlist.c +2 -0
index b0925a3..249f6b9 100644
@@ -315,6 +315,7 @@ struct netlbl_af6list *netlbl_af6list_remove(const struct in6_addr *addr,
  * Audit Helper Functions
  */
 
+#ifdef CONFIG_AUDIT
 /**
  * netlbl_af4list_audit_addr - Audit an IPv4 address
  * @audit_buf: audit buffer
@@ -386,3 +387,4 @@ void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf,
 	}
 }
 #endif /* IPv6 */
+#endif /* CONFIG_AUDIT */
net/netlabel/netlabel_addrlist.h +22 -0
index 0242bea..07ae7fd 100644
@@ -120,9 +120,19 @@ struct netlbl_af4list *netlbl_af4list_search(__be32 addr,
 struct netlbl_af4list *netlbl_af4list_search_exact(__be32 addr,
 						   __be32 mask,
 						   struct list_head *head);
+
+#ifdef CONFIG_AUDIT
 void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
 			       int src, const char *dev,
 			       __be32 addr, __be32 mask);
+#else
+static inline void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
+					     int src, const char *dev,
+					     __be32 addr, __be32 mask)
+{
+	return;
+}
+#endif
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 
@@ -179,11 +189,23 @@ struct netlbl_af6list *netlbl_af6list_search(const struct in6_addr *addr,
 struct netlbl_af6list *netlbl_af6list_search_exact(const struct in6_addr *addr,
 						   const struct in6_addr *mask,
 						   struct list_head *head);
+
+#ifdef CONFIG_AUDIT
 void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf,
 			       int src,
 			       const char *dev,
 			       const struct in6_addr *addr,
 			       const struct in6_addr *mask);
+#else
+static inline void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf,
+					     int src,
+					     const char *dev,
+					     const struct in6_addr *addr,
+					     const struct in6_addr *mask)
+{
+	return;
+}
+#endif
 #endif /* IPV6 */
 
 #endif
maintainer
#4 lore raw
In reply to Paul Moore

From: Paul Moore <[email protected]>
Date: Thu, 30 Oct 2008 13:10:13 -0400

Quoted 4 lines

Three small fixes to solve compiler warnings and a possible run-time issue, please pull from the following tree:

git://git.infradead.org/users/pcmoore/lblnet-2.6

Pulled, thanks a lot Paul.