]> git.neil.brown.name Git - history.git/commitdiff
[IPVS]: remove some unused fields from the protocols
authorJulian Anastasov <ja@ssi.bg>
Tue, 7 Oct 2003 00:46:40 +0000 (17:46 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Tue, 7 Oct 2003 00:46:40 +0000 (17:46 -0700)
include/net/ip_vs.h
net/ipv4/ipvs/ip_vs_core.c
net/ipv4/ipvs/ip_vs_proto_ah.c
net/ipv4/ipvs/ip_vs_proto_esp.c
net/ipv4/ipvs/ip_vs_proto_icmp.c
net/ipv4/ipvs/ip_vs_proto_tcp.c
net/ipv4/ipvs/ip_vs_proto_udp.c

index 12bcb8126ec1860a126a809e8c67655b8287549f..08a4a652764c8e599052dce01b2fd667861cdf34 100644 (file)
@@ -435,11 +435,7 @@ struct ip_vs_protocol {
        struct ip_vs_protocol   *next;
        char                    *name;
        __u16                   protocol;
-       int                     minhlen;
-       int                     minhlen_icmp;
        int                     dont_defrag;
-       int                     skip_nonexisting;
-       int                     slave;          /* if controlled by others */
        atomic_t                appcnt;         /* counter of proto app incs */
        int                     *timeout_table; /* protocol timeout table */
 
@@ -528,7 +524,10 @@ struct ip_vs_conn {
        struct ip_vs_dest       *dest;          /* real server */
        atomic_t                in_pkts;        /* incoming packet counter */
 
-       /* packet transmitter for different forwarding methods */
+       /* packet transmitter for different forwarding methods.  If it
+          mangles the packet, it must return NF_DROP or NF_STOLEN, otherwise
+          this must be changed to a sk_buff **.
+        */
        int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp,
                           struct ip_vs_protocol *pp);
 
index caba4cc55d51f25c571ccbca6aaaeb5a59fd9f0f..bb62e6569da9cbcb77d063ea4ad985843cb8997d 100644 (file)
@@ -660,7 +660,7 @@ static int ip_vs_out_icmp(struct sk_buff **pskb, int *related)
 
        /* Is the embedded protocol header present? */
        if (unlikely(ciph.frag_off & __constant_htons(IP_OFFSET) &&
-                    (pp->minhlen || pp->dont_defrag)))
+                    pp->dont_defrag))
                return NF_ACCEPT;
 
        IP_VS_DBG_PKT(11, pp, skb, offset, "Checking outgoing ICMP for");
@@ -911,7 +911,7 @@ static int ip_vs_in_icmp(struct sk_buff **pskb, int *related)
 
        /* Is the embedded protocol header present? */
        if (unlikely(ciph.frag_off & __constant_htons(IP_OFFSET) &&
-                    (pp->minhlen || pp->dont_defrag)))
+                    pp->dont_defrag))
                return NF_ACCEPT;
 
        IP_VS_DBG_PKT(11, pp, skb, offset, "Checking incoming ICMP for");
index 11f9f62b7e9d45bff5bdfdc66e80b9615c585443..6cbb02bfb4e8659544ef6d78e1203a7d8a1dd6aa 100644 (file)
@@ -69,11 +69,11 @@ ah_conn_in_get(const struct sk_buff *skb,
        if (!cp) {
                /*
                 * We are not sure if the packet is from our
-                * service, so the caller should check skip_nonexisting
+                * service, so our conn_schedule hook should return NF_ACCEPT
                 */
                IP_VS_DBG(12, "Unknown ISAKMP entry for outin packet "
                          "%s%s %u.%u.%u.%u->%u.%u.%u.%u\n",
-                         inverse?"ICMP+":"",
+                         inverse ? "ICMP+" : "",
                          pp->name,
                          NIPQUAD(iph->saddr),
                          NIPQUAD(iph->daddr));
@@ -104,11 +104,6 @@ ah_conn_out_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
        }
 
        if (!cp) {
-               /*
-                * We are not sure if the packet is from our
-                * service, so the caller should check skip_nonexisting
-                * or our conn_schedule hook should return NF_ACCEPT
-                */
                IP_VS_DBG(12, "Unknown ISAKMP entry for inout packet "
                          "%s%s %u.%u.%u.%u->%u.%u.%u.%u\n",
                          inverse ? "ICMP+" : "",
@@ -167,11 +162,7 @@ static void ah_exit(struct ip_vs_protocol *pp)
 struct ip_vs_protocol ip_vs_protocol_ah = {
        .name =                 "AH",
        .protocol =             IPPROTO_AH,
-       .minhlen =              0,
-       .minhlen_icmp =         0,
        .dont_defrag =          1,
-       .skip_nonexisting =     1,
-       .slave =                1,
        .init =                 ah_init,
        .exit =                 ah_exit,
        .conn_schedule =        ah_conn_schedule,
@@ -179,11 +170,11 @@ struct ip_vs_protocol ip_vs_protocol_ah = {
        .conn_out_get =         ah_conn_out_get,
        .snat_handler =         NULL,
        .dnat_handler =         NULL,
+       .csum_check =           NULL,
        .state_transition =     NULL,
        .register_app =         NULL,
        .unregister_app =       NULL,
        .app_conn_bind =        NULL,
-       .csum_check =           NULL,
        .debug_packet =         ah_debug_packet,
        .timeout_change =       NULL,           /* ISAKMP */
        .set_state_timeout =    NULL,
index 681699de3bb7a221fb0a68e52e97bce2ed2c40a1..aeaa3daf6aad4a3bcdb5ffb179414914afb6f48d 100644 (file)
@@ -69,7 +69,7 @@ esp_conn_in_get(const struct sk_buff *skb,
        if (!cp) {
                /*
                 * We are not sure if the packet is from our
-                * service, so the caller should check skip_nonexisting
+                * service, so our conn_schedule hook should return NF_ACCEPT
                 */
                IP_VS_DBG(12, "Unknown ISAKMP entry for outin packet "
                          "%s%s %u.%u.%u.%u->%u.%u.%u.%u\n",
@@ -104,14 +104,9 @@ esp_conn_out_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
        }
 
        if (!cp) {
-               /*
-                * We are not sure if the packet is from our
-                * service, so the caller should check skip_nonexisting
-                * or our conn_schedule hook should return NF_ACCEPT
-                */
                IP_VS_DBG(12, "Unknown ISAKMP entry for inout packet "
                          "%s%s %u.%u.%u.%u->%u.%u.%u.%u\n",
-                         inverse?"ICMP+":"",
+                         inverse ? "ICMP+" : "",
                          pp->name,
                          NIPQUAD(iph->saddr),
                          NIPQUAD(iph->daddr));
@@ -166,11 +161,7 @@ static void esp_exit(struct ip_vs_protocol *pp)
 struct ip_vs_protocol ip_vs_protocol_esp = {
        .name =                 "ESP",
        .protocol =             IPPROTO_ESP,
-       .minhlen =              0,
-       .minhlen_icmp =         0,
        .dont_defrag =          1,
-       .skip_nonexisting =     1,
-       .slave =                1,
        .init =                 esp_init,
        .exit =                 esp_exit,
        .conn_schedule =        esp_conn_schedule,
index b411e742780c66b678ce7a1c73c70f3aa1c20c0d..077643f6ab5ebe60208a7bfa4282f0d9495cd8d8 100644 (file)
@@ -163,11 +163,7 @@ static void icmp_exit(struct ip_vs_protocol *pp)
 struct ip_vs_protocol ip_vs_protocol_icmp = {
        .name =                 "ICMP",
        .protocol =             IPPROTO_ICMP,
-       .minhlen =              sizeof(struct icmphdr),
-       .minhlen_icmp =         8,
        .dont_defrag =          0,
-       .skip_nonexisting =     0,
-       .slave =                0,
        .init =                 icmp_init,
        .exit =                 icmp_exit,
        .conn_schedule =        icmp_conn_schedule,
index 212cbfa826739f8de2a3418e866318154fad6fda..e5a78d2d7dc2e4c22feab8bfcf0bf194bc0618ea 100644 (file)
@@ -132,7 +132,7 @@ tcp_snat_handler(struct sk_buff **pskb,
 
        if (unlikely(cp->app != NULL)) {
                /* Some checks before mangling */
-               if (pp->csum_check && !pp->slave && !pp->csum_check(*pskb, pp))
+               if (pp->csum_check && !pp->csum_check(*pskb, pp))
                        return 0;
 
                /* Call application helper if needed */
@@ -180,7 +180,7 @@ tcp_dnat_handler(struct sk_buff **pskb,
 
        if (unlikely(cp->app != NULL)) {
                /* Some checks before mangling */
-               if (pp->csum_check && !pp->slave && !pp->csum_check(*pskb, pp))
+               if (pp->csum_check && !pp->csum_check(*pskb, pp))
                        return 0;
 
                /*
@@ -614,11 +614,7 @@ static void tcp_exit(struct ip_vs_protocol *pp)
 struct ip_vs_protocol ip_vs_protocol_tcp = {
        .name =                 "TCP",
        .protocol =             IPPROTO_TCP,
-       .minhlen =              sizeof(struct tcphdr),
-       .minhlen_icmp =         8,
        .dont_defrag =          0,
-       .skip_nonexisting =     0,
-       .slave =                0,
        .appcnt =               ATOMIC_INIT(0),
        .init =                 tcp_init,
        .exit =                 tcp_exit,
index e4eea41ff76725505070296c0c985c64d9c376a9..740d8d92c2fcbaf276649c0e0e89ac1d3eefdb23 100644 (file)
@@ -133,7 +133,7 @@ udp_snat_handler(struct sk_buff **pskb,
 
        if (unlikely(cp->app != NULL)) {
                /* Some checks before mangling */
-               if (pp->csum_check && !pp->slave && !pp->csum_check(*pskb, pp))
+               if (pp->csum_check && !pp->csum_check(*pskb, pp))
                        return 0;
 
                /*
@@ -187,7 +187,7 @@ udp_dnat_handler(struct sk_buff **pskb,
 
        if (unlikely(cp->app != NULL)) {
                /* Some checks before mangling */
-               if (pp->csum_check && !pp->slave && !pp->csum_check(*pskb, pp))
+               if (pp->csum_check && !pp->csum_check(*pskb, pp))
                        return 0;
 
                /*
@@ -401,11 +401,7 @@ static void udp_exit(struct ip_vs_protocol *pp)
 struct ip_vs_protocol ip_vs_protocol_udp = {
        .name =                 "UDP",
        .protocol =             IPPROTO_UDP,
-       .minhlen =              sizeof(struct udphdr),
-       .minhlen_icmp =         8,
        .dont_defrag =          0,
-       .skip_nonexisting =     0,
-       .slave =                0,
        .init =                 udp_init,
        .exit =                 udp_exit,
        .conn_schedule =        udp_conn_schedule,