]> err.no Git - linux-2.6/blobdiff - net/ipv4/ipvs/ip_vs_proto.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / net / ipv4 / ipvs / ip_vs_proto.c
index 867d4e9c6594c3a62eb70475d6b2c26cfe74c2ca..876714f23d6514135ae4401cb1561f1e00684b4e 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * ip_vs_proto.c: transport protocol load balancing support for IPVS
  *
- * Version:     $Id: ip_vs_proto.c,v 1.2 2003/04/18 09:03:16 wensong Exp $
- *
  * Authors:     Wensong Zhang <wensong@linuxvirtualserver.org>
  *              Julian Anastasov <ja@ssi.bg>
  *
@@ -45,7 +43,7 @@ static struct ip_vs_protocol *ip_vs_proto_table[IP_VS_PROTO_TAB_SIZE];
 /*
  *     register an ipvs protocol
  */
-static int register_ip_vs_protocol(struct ip_vs_protocol *pp)
+static int __used register_ip_vs_protocol(struct ip_vs_protocol *pp)
 {
        unsigned hash = IP_VS_PROTO_HASH(pp->protocol);
 
@@ -118,13 +116,7 @@ void ip_vs_protocol_timeout_change(int flags)
 int *
 ip_vs_create_timeout_table(int *table, int size)
 {
-       int *t;
-
-       t = kmalloc(size, GFP_ATOMIC);
-       if (t == NULL)
-               return NULL;
-       memcpy(t, table, size);
-       return t;
+       return kmemdup(table, size, GFP_ATOMIC);
 }
 
 
@@ -154,7 +146,7 @@ const char * ip_vs_state_name(__u16 proto, int state)
        struct ip_vs_protocol *pp = ip_vs_proto_get(proto);
 
        if (pp == NULL || pp->state_name == NULL)
-               return "ERR!";
+               return (IPPROTO_IP == proto) ? "NONE" : "ERR!";
        return pp->state_name(state);
 }
 
@@ -171,12 +163,12 @@ ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp,
        ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph);
        if (ih == NULL)
                sprintf(buf, "%s TRUNCATED", pp->name);
-       else if (ih->frag_off & __constant_htons(IP_OFFSET))
+       else if (ih->frag_off & htons(IP_OFFSET))
                sprintf(buf, "%s %u.%u.%u.%u->%u.%u.%u.%u frag",
                        pp->name, NIPQUAD(ih->saddr),
                        NIPQUAD(ih->daddr));
        else {
-               __u16 _ports[2], *pptr
+               __be16 _ports[2], *pptr
 ;
                pptr = skb_header_pointer(skb, offset + ih->ihl*4,
                                          sizeof(_ports), _ports);