Skip to contentSkip to conversation

nf: make skb_make_writable() return bool

PATCH In review Changli Gao 2 participants 2 messages Jul 31, 2010 – Aug 2, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nf: make skb_make_writable() return bool

----

 include/linux/netfilter.h |    2 +-
 net/netfilter/core.c      |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
include/linux/netfilter.h +1 -1
index 89341c3..9dc919b 100644
@@ -243,7 +243,7 @@ int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval,
 /* Call this before modifying an existing packet: ensures it is
    modifiable and linear to the point you care about (writable_len).
    Returns true or false. */
-extern int skb_make_writable(struct sk_buff *skb, unsigned int writable_len);
+extern bool skb_make_writable(struct sk_buff *skb, unsigned int writable_len);
 
 struct flowi;
 struct nf_queue_entry;
net/netfilter/core.c +4 -4
index 78b505d..274ab8c 100644
@@ -189,17 +189,17 @@ next_hook:
 EXPORT_SYMBOL(nf_hook_slow);
 
 
-int skb_make_writable(struct sk_buff *skb, unsigned int writable_len)
+bool skb_make_writable(struct sk_buff *skb, unsigned int writable_len)
 {
 	if (writable_len > skb->len)
-		return 0;
+		return false;
 
 	/* Not exclusive use of packet?  Must copy. */
 	if (!skb_cloned(skb)) {
 		if (writable_len <= skb_headlen(skb))
-			return 1;
+			return true;
 	} else if (skb_clone_writable(skb, writable_len))
-		return 1;
+		return true;
 
 	if (writable_len <= skb_headlen(skb))
 		writable_len = 0;
#1 lore raw

net/netfilter/core.c next_hook: · line 192

Quoted 5 lines · Changli Gao

----

net/netfilter/core.c +1 -1
-int skb_make_writable(struct sk_buff *skb, unsigned int writable_len)
+bool skb_make_writable(struct sk_buff *skb, unsigned int writable_len)

You can change things like this when making actual changes to the code, but this is just useless noise in the changelogs and makes it harder to locate real changes in the history.