diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-10-24 00:07:32 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-24 00:27:55 -0400 |
commit | c2636b4d9e8ab8d16b9e2bf0f0744bb8418d4026 (patch) | |
tree | 4db39ee9b93871385d72e776bec2e640166e3b34 | |
parent | 0ffdd581497286e8af529b0b39770c01eab15b30 (diff) |
[NET]: Treat the sign of the result of skb_headroom() consistently
In some places, the result of skb_headroom() is compared to an unsigned
integer, and in others, the result is compared to a signed integer. Make
the comparisons consistent and correct.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/skbuff.h | 4 | ||||
-rw-r--r-- | net/ipv4/ip_gre.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipip.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_xmit.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 2 | ||||
-rw-r--r-- | net/ipv6/sit.c | 2 |
9 files changed, 10 insertions, 10 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index fd4e12f24270..94e49915a8c0 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -994,7 +994,7 @@ static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len) | |||
994 | * | 994 | * |
995 | * Return the number of bytes of free space at the head of an &sk_buff. | 995 | * Return the number of bytes of free space at the head of an &sk_buff. |
996 | */ | 996 | */ |
997 | static inline int skb_headroom(const struct sk_buff *skb) | 997 | static inline unsigned int skb_headroom(const struct sk_buff *skb) |
998 | { | 998 | { |
999 | return skb->data - skb->head; | 999 | return skb->data - skb->head; |
1000 | } | 1000 | } |
@@ -1347,7 +1347,7 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev, | |||
1347 | * Returns true if modifying the header part of the cloned buffer | 1347 | * Returns true if modifying the header part of the cloned buffer |
1348 | * does not requires the data to be copied. | 1348 | * does not requires the data to be copied. |
1349 | */ | 1349 | */ |
1350 | static inline int skb_clone_writable(struct sk_buff *skb, int len) | 1350 | static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len) |
1351 | { | 1351 | { |
1352 | return !skb_header_cloned(skb) && | 1352 | return !skb_header_cloned(skb) && |
1353 | skb_headroom(skb) + len <= skb->hdr_len; | 1353 | skb_headroom(skb) + len <= skb->hdr_len; |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index c5b77bbbe844..02b02a8d681c 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -674,7 +674,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
674 | struct rtable *rt; /* Route to the other host */ | 674 | struct rtable *rt; /* Route to the other host */ |
675 | struct net_device *tdev; /* Device to other host */ | 675 | struct net_device *tdev; /* Device to other host */ |
676 | struct iphdr *iph; /* Our new IP header */ | 676 | struct iphdr *iph; /* Our new IP header */ |
677 | int max_headroom; /* The extra header space needed */ | 677 | unsigned int max_headroom; /* The extra header space needed */ |
678 | int gre_hlen; | 678 | int gre_hlen; |
679 | __be32 dst; | 679 | __be32 dst; |
680 | int mtu; | 680 | int mtu; |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index f508835ba713..e5f7dc2de303 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -161,7 +161,7 @@ static inline int ip_finish_output2(struct sk_buff *skb) | |||
161 | struct dst_entry *dst = skb->dst; | 161 | struct dst_entry *dst = skb->dst; |
162 | struct rtable *rt = (struct rtable *)dst; | 162 | struct rtable *rt = (struct rtable *)dst; |
163 | struct net_device *dev = dst->dev; | 163 | struct net_device *dev = dst->dev; |
164 | int hh_len = LL_RESERVED_SPACE(dev); | 164 | unsigned int hh_len = LL_RESERVED_SPACE(dev); |
165 | 165 | ||
166 | if (rt->rt_type == RTN_MULTICAST) | 166 | if (rt->rt_type == RTN_MULTICAST) |
167 | IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS); | 167 | IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS); |
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 5cd5bbe1379a..8c2b2b0741da 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -515,7 +515,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
515 | struct net_device *tdev; /* Device to other host */ | 515 | struct net_device *tdev; /* Device to other host */ |
516 | struct iphdr *old_iph = ip_hdr(skb); | 516 | struct iphdr *old_iph = ip_hdr(skb); |
517 | struct iphdr *iph; /* Our new IP header */ | 517 | struct iphdr *iph; /* Our new IP header */ |
518 | int max_headroom; /* The extra header space needed */ | 518 | unsigned int max_headroom; /* The extra header space needed */ |
519 | __be32 dst = tiph->daddr; | 519 | __be32 dst = tiph->daddr; |
520 | int mtu; | 520 | int mtu; |
521 | 521 | ||
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c index d0a92dec1050..7c074e386c17 100644 --- a/net/ipv4/ipvs/ip_vs_xmit.c +++ b/net/ipv4/ipvs/ip_vs_xmit.c | |||
@@ -325,7 +325,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
325 | __be16 df = old_iph->frag_off; | 325 | __be16 df = old_iph->frag_off; |
326 | sk_buff_data_t old_transport_header = skb->transport_header; | 326 | sk_buff_data_t old_transport_header = skb->transport_header; |
327 | struct iphdr *iph; /* Our new IP header */ | 327 | struct iphdr *iph; /* Our new IP header */ |
328 | int max_headroom; /* The extra header space needed */ | 328 | unsigned int max_headroom; /* The extra header space needed */ |
329 | int mtu; | 329 | int mtu; |
330 | 330 | ||
331 | EnterFunction(10); | 331 | EnterFunction(10); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 9288220b73a8..3dbbb44b3e7d 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -3909,7 +3909,7 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list, | |||
3909 | 3909 | ||
3910 | while (before(start, end)) { | 3910 | while (before(start, end)) { |
3911 | struct sk_buff *nskb; | 3911 | struct sk_buff *nskb; |
3912 | int header = skb_headroom(skb); | 3912 | unsigned int header = skb_headroom(skb); |
3913 | int copy = SKB_MAX_ORDER(header, 0); | 3913 | int copy = SKB_MAX_ORDER(header, 0); |
3914 | 3914 | ||
3915 | /* Too big header? This can happen with IPv6. */ | 3915 | /* Too big header? This can happen with IPv6. */ |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 13565dfb1b45..653fc0a8235b 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -171,7 +171,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl, | |||
171 | u32 mtu; | 171 | u32 mtu; |
172 | 172 | ||
173 | if (opt) { | 173 | if (opt) { |
174 | int head_room; | 174 | unsigned int head_room; |
175 | 175 | ||
176 | /* First: exthdrs may take lots of space (~8K for now) | 176 | /* First: exthdrs may take lots of space (~8K for now) |
177 | MAX_HEADER is not enough. | 177 | MAX_HEADER is not enough. |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 2320cc27ff9e..5383b33db8ca 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -838,7 +838,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb, | |||
838 | struct dst_entry *dst; | 838 | struct dst_entry *dst; |
839 | struct net_device *tdev; | 839 | struct net_device *tdev; |
840 | int mtu; | 840 | int mtu; |
841 | int max_headroom = sizeof(struct ipv6hdr); | 841 | unsigned int max_headroom = sizeof(struct ipv6hdr); |
842 | u8 proto; | 842 | u8 proto; |
843 | int err = -1; | 843 | int err = -1; |
844 | int pkt_len; | 844 | int pkt_len; |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 466657a9a8bd..71433d29d884 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -430,7 +430,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
430 | struct rtable *rt; /* Route to the other host */ | 430 | struct rtable *rt; /* Route to the other host */ |
431 | struct net_device *tdev; /* Device to other host */ | 431 | struct net_device *tdev; /* Device to other host */ |
432 | struct iphdr *iph; /* Our new IP header */ | 432 | struct iphdr *iph; /* Our new IP header */ |
433 | int max_headroom; /* The extra header space needed */ | 433 | unsigned int max_headroom; /* The extra header space needed */ |
434 | __be32 dst = tiph->daddr; | 434 | __be32 dst = tiph->daddr; |
435 | int mtu; | 435 | int mtu; |
436 | struct in6_addr *addr6; | 436 | struct in6_addr *addr6; |