]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[NET]: Treat the sign of the result of skb_headroom() consistently
authorChuck Lever <chuck.lever@oracle.com>
Wed, 24 Oct 2007 04:07:32 +0000 (21:07 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 24 Oct 2007 04:27:55 +0000 (21:27 -0700)
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>
include/linux/skbuff.h
net/ipv4/ip_gre.c
net/ipv4/ip_output.c
net/ipv4/ipip.c
net/ipv4/ipvs/ip_vs_xmit.c
net/ipv4/tcp_input.c
net/ipv6/ip6_output.c
net/ipv6/ip6_tunnel.c
net/ipv6/sit.c

index fd4e12f24270d608951328fec3c09ed791188893..94e49915a8c0e1113091bd12261f349f852ef6ad 100644 (file)
@@ -994,7 +994,7 @@ static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len)
  *
  *     Return the number of bytes of free space at the head of an &sk_buff.
  */
-static inline int skb_headroom(const struct sk_buff *skb)
+static inline unsigned int skb_headroom(const struct sk_buff *skb)
 {
        return skb->data - skb->head;
 }
@@ -1347,7 +1347,7 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
  *     Returns true if modifying the header part of the cloned buffer
  *     does not requires the data to be copied.
  */
-static inline int skb_clone_writable(struct sk_buff *skb, int len)
+static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len)
 {
        return !skb_header_cloned(skb) &&
               skb_headroom(skb) + len <= skb->hdr_len;
index c5b77bbbe84416a6ce438a64efd424cfce569115..02b02a8d681c85680d33d05bc2bdd7b710ef2672 100644 (file)
@@ -674,7 +674,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
        struct rtable *rt;                      /* Route to the other host */
        struct net_device *tdev;                        /* Device to other host */
        struct iphdr  *iph;                     /* Our new IP header */
-       int    max_headroom;                    /* The extra header space needed */
+       unsigned int max_headroom;              /* The extra header space needed */
        int    gre_hlen;
        __be32 dst;
        int    mtu;
index f508835ba7137a3ae5cf79e6f2e5bd83f92fe0e9..e5f7dc2de30349c8045bdadc5e77940bcf97680d 100644 (file)
@@ -161,7 +161,7 @@ static inline int ip_finish_output2(struct sk_buff *skb)
        struct dst_entry *dst = skb->dst;
        struct rtable *rt = (struct rtable *)dst;
        struct net_device *dev = dst->dev;
-       int hh_len = LL_RESERVED_SPACE(dev);
+       unsigned int hh_len = LL_RESERVED_SPACE(dev);
 
        if (rt->rt_type == RTN_MULTICAST)
                IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
index 5cd5bbe1379aa10c343631bdd05dfa322041d347..8c2b2b0741daeb4ac118ea39721ecaab19ad00fb 100644 (file)
@@ -515,7 +515,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
        struct net_device *tdev;                        /* Device to other host */
        struct iphdr  *old_iph = ip_hdr(skb);
        struct iphdr  *iph;                     /* Our new IP header */
-       int    max_headroom;                    /* The extra header space needed */
+       unsigned int max_headroom;              /* The extra header space needed */
        __be32 dst = tiph->daddr;
        int    mtu;
 
index d0a92dec1050697efabb196164bcf639a31802c8..7c074e386c17235a3f9a98bd350a390b316f4835 100644 (file)
@@ -325,7 +325,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
        __be16 df = old_iph->frag_off;
        sk_buff_data_t old_transport_header = skb->transport_header;
        struct iphdr  *iph;                     /* Our new IP header */
-       int    max_headroom;                    /* The extra header space needed */
+       unsigned int max_headroom;              /* The extra header space needed */
        int    mtu;
 
        EnterFunction(10);
index 9288220b73a8d80abf9a7fff748269930d8f8a8a..3dbbb44b3e7d503df2f4e91fd154be87b0f01152 100644 (file)
@@ -3909,7 +3909,7 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list,
 
        while (before(start, end)) {
                struct sk_buff *nskb;
-               int header = skb_headroom(skb);
+               unsigned int header = skb_headroom(skb);
                int copy = SKB_MAX_ORDER(header, 0);
 
                /* Too big header? This can happen with IPv6. */
index 13565dfb1b4559ccb92dd5a5605e5d42f759959e..653fc0a8235b636e6e03921b77163a8ee8817b5c 100644 (file)
@@ -171,7 +171,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
        u32 mtu;
 
        if (opt) {
-               int head_room;
+               unsigned int head_room;
 
                /* First: exthdrs may take lots of space (~8K for now)
                   MAX_HEADER is not enough.
index 2320cc27ff9e305328cc8bc04103851d04b88a9b..5383b33db8ca606cb23edfed9cdfad018ef9a74d 100644 (file)
@@ -838,7 +838,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
        struct dst_entry *dst;
        struct net_device *tdev;
        int mtu;
-       int max_headroom = sizeof(struct ipv6hdr);
+       unsigned int max_headroom = sizeof(struct ipv6hdr);
        u8 proto;
        int err = -1;
        int pkt_len;
index 466657a9a8bd813e4f07afbfef261b9200d38c83..71433d29d8846e162f0be47bf200768958bb9a44 100644 (file)
@@ -430,7 +430,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
        struct rtable *rt;                      /* Route to the other host */
        struct net_device *tdev;                        /* Device to other host */
        struct iphdr  *iph;                     /* Our new IP header */
-       int    max_headroom;                    /* The extra header space needed */
+       unsigned int max_headroom;              /* The extra header space needed */
        __be32 dst = tiph->daddr;
        int    mtu;
        struct in6_addr *addr6;