]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ipvs: oldlen, newlen should be be16, not be32
authorHarvey Harrison <harvey.harrison@gmail.com>
Fri, 7 Nov 2008 07:09:56 +0000 (23:09 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Nov 2008 07:09:56 +0000 (23:09 -0800)
Noticed by sparse:
net/netfilter/ipvs/ip_vs_proto_tcp.c:195:6: warning: incorrect type in argument 5 (different base types)
net/netfilter/ipvs/ip_vs_proto_tcp.c:195:6:    expected restricted __be16 [usertype] oldlen
net/netfilter/ipvs/ip_vs_proto_tcp.c:195:6:    got restricted __be32 [usertype] <noident>
net/netfilter/ipvs/ip_vs_proto_tcp.c:196:6: warning: incorrect type in argument 6 (different base types)
net/netfilter/ipvs/ip_vs_proto_tcp.c:196:6:    expected restricted __be16 [usertype] newlen
net/netfilter/ipvs/ip_vs_proto_tcp.c:196:6:    got restricted __be32 [usertype] <noident>
net/netfilter/ipvs/ip_vs_proto_tcp.c:270:6: warning: incorrect type in argument 5 (different base types)
net/netfilter/ipvs/ip_vs_proto_tcp.c:270:6:    expected restricted __be16 [usertype] oldlen
net/netfilter/ipvs/ip_vs_proto_tcp.c:270:6:    got restricted __be32 [usertype] <noident>
net/netfilter/ipvs/ip_vs_proto_tcp.c:271:6: warning: incorrect type in argument 6 (different base types)
net/netfilter/ipvs/ip_vs_proto_tcp.c:271:6:    expected restricted __be16 [usertype] newlen
net/netfilter/ipvs/ip_vs_proto_tcp.c:271:6:    got restricted __be32 [usertype] <noident>
net/netfilter/ipvs/ip_vs_proto_udp.c:206:6: warning: incorrect type in argument 5 (different base types)
net/netfilter/ipvs/ip_vs_proto_udp.c:206:6:    expected restricted __be16 [usertype] oldlen
net/netfilter/ipvs/ip_vs_proto_udp.c:206:6:    got restricted __be32 [usertype] <noident>
net/netfilter/ipvs/ip_vs_proto_udp.c:207:6: warning: incorrect type in argument 6 (different base types)
net/netfilter/ipvs/ip_vs_proto_udp.c:207:6:    expected restricted __be16 [usertype] newlen
net/netfilter/ipvs/ip_vs_proto_udp.c:207:6:    got restricted __be32 [usertype] <noident>
net/netfilter/ipvs/ip_vs_proto_udp.c:282:6: warning: incorrect type in argument 5 (different base types)
net/netfilter/ipvs/ip_vs_proto_udp.c:282:6:    expected restricted __be16 [usertype] oldlen
net/netfilter/ipvs/ip_vs_proto_udp.c:282:6:    got restricted __be32 [usertype] <noident>
net/netfilter/ipvs/ip_vs_proto_udp.c:283:6: warning: incorrect type in argument 6 (different base types)
net/netfilter/ipvs/ip_vs_proto_udp.c:283:6:    expected restricted __be16 [usertype] newlen
net/netfilter/ipvs/ip_vs_proto_udp.c:283:6:    got restricted __be32 [usertype] <noident>

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/ipvs/ip_vs_proto_tcp.c
net/netfilter/ipvs/ip_vs_proto_udp.c

index dd4566ea2bff7bce68baabf916eb4b9ae25c9a6f..8cba41802850b041e5062c38f786da00f3ed6697 100644 (file)
@@ -192,8 +192,8 @@ tcp_snat_handler(struct sk_buff *skb,
        /* Adjust TCP checksums */
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
                tcp_partial_csum_update(cp->af, tcph, &cp->daddr, &cp->vaddr,
-                                       htonl(oldlen),
-                                       htonl(skb->len - tcphoff));
+                                       htons(oldlen),
+                                       htons(skb->len - tcphoff));
        } else if (!cp->app) {
                /* Only port and addr are changed, do fast csum update */
                tcp_fast_csum_update(cp->af, tcph, &cp->daddr, &cp->vaddr,
@@ -267,8 +267,8 @@ tcp_dnat_handler(struct sk_buff *skb,
         */
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
                tcp_partial_csum_update(cp->af, tcph, &cp->daddr, &cp->vaddr,
-                                       htonl(oldlen),
-                                       htonl(skb->len - tcphoff));
+                                       htons(oldlen),
+                                       htons(skb->len - tcphoff));
        } else if (!cp->app) {
                /* Only port and addr are changed, do fast csum update */
                tcp_fast_csum_update(cp->af, tcph, &cp->vaddr, &cp->daddr,
index 6eb6039d63434f6ecc4bd511edb390e0e91bbd6a..d2930a71084bd3079e980ba7af0ecdb4d00204fa 100644 (file)
@@ -203,8 +203,8 @@ udp_snat_handler(struct sk_buff *skb,
         */
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
                udp_partial_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr,
-                                       htonl(oldlen),
-                                       htonl(skb->len - udphoff));
+                                       htons(oldlen),
+                                       htons(skb->len - udphoff));
        } else if (!cp->app && (udph->check != 0)) {
                /* Only port and addr are changed, do fast csum update */
                udp_fast_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr,
@@ -279,8 +279,8 @@ udp_dnat_handler(struct sk_buff *skb,
         */
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
                udp_partial_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr,
-                                       htonl(oldlen),
-                                       htonl(skb->len - udphoff));
+                                       htons(oldlen),
+                                       htons(skb->len - udphoff));
        } else if (!cp->app && (udph->check != 0)) {
                /* Only port and addr are changed, do fast csum update */
                udp_fast_csum_update(cp->af, udph, &cp->vaddr, &cp->daddr,