Commit 4a516f11 authored by Simon Horman's avatar Simon Horman Committed by Pablo Neira Ayuso

ipvs: Remove unused return value of protocol state transitions

Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
Acked-by Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 3c2de2ae
...@@ -425,9 +425,9 @@ struct ip_vs_protocol { ...@@ -425,9 +425,9 @@ struct ip_vs_protocol {
const char *(*state_name)(int state); const char *(*state_name)(int state);
int (*state_transition)(struct ip_vs_conn *cp, int direction, void (*state_transition)(struct ip_vs_conn *cp, int direction,
const struct sk_buff *skb, const struct sk_buff *skb,
struct ip_vs_proto_data *pd); struct ip_vs_proto_data *pd);
int (*register_app)(struct net *net, struct ip_vs_app *inc); int (*register_app)(struct net *net, struct ip_vs_app *inc);
......
...@@ -188,14 +188,13 @@ ip_vs_conn_stats(struct ip_vs_conn *cp, struct ip_vs_service *svc) ...@@ -188,14 +188,13 @@ ip_vs_conn_stats(struct ip_vs_conn *cp, struct ip_vs_service *svc)
} }
static inline int static inline void
ip_vs_set_state(struct ip_vs_conn *cp, int direction, ip_vs_set_state(struct ip_vs_conn *cp, int direction,
const struct sk_buff *skb, const struct sk_buff *skb,
struct ip_vs_proto_data *pd) struct ip_vs_proto_data *pd)
{ {
if (unlikely(!pd->pp->state_transition)) if (likely(pd->pp->state_transition))
return 0; pd->pp->state_transition(cp, direction, skb, pd);
return pd->pp->state_transition(cp, direction, skb, pd);
} }
static inline int static inline int
...@@ -557,7 +556,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, ...@@ -557,7 +556,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
ip_vs_in_stats(cp, skb); ip_vs_in_stats(cp, skb);
/* set state */ /* set state */
cs = ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd); ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd);
/* transmit the first SYN packet */ /* transmit the first SYN packet */
ret = cp->packet_xmit(skb, cp, pd->pp); ret = cp->packet_xmit(skb, cp, pd->pp);
...@@ -1490,7 +1489,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) ...@@ -1490,7 +1489,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
struct ip_vs_protocol *pp; struct ip_vs_protocol *pp;
struct ip_vs_proto_data *pd; struct ip_vs_proto_data *pd;
struct ip_vs_conn *cp; struct ip_vs_conn *cp;
int ret, restart, pkts; int ret, pkts;
struct netns_ipvs *ipvs; struct netns_ipvs *ipvs;
/* Already marked as IPVS request or reply? */ /* Already marked as IPVS request or reply? */
...@@ -1591,7 +1590,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) ...@@ -1591,7 +1590,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
} }
ip_vs_in_stats(cp, skb); ip_vs_in_stats(cp, skb);
restart = ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd); ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd);
if (cp->packet_xmit) if (cp->packet_xmit)
ret = cp->packet_xmit(skb, cp, pp); ret = cp->packet_xmit(skb, cp, pp);
/* do not touch skb anymore */ /* do not touch skb anymore */
......
...@@ -906,7 +906,7 @@ static const char *sctp_state_name(int state) ...@@ -906,7 +906,7 @@ static const char *sctp_state_name(int state)
return "?"; return "?";
} }
static inline int static inline void
set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
int direction, const struct sk_buff *skb) int direction, const struct sk_buff *skb)
{ {
...@@ -924,7 +924,7 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, ...@@ -924,7 +924,7 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
sch = skb_header_pointer(skb, ihl + sizeof(sctp_sctphdr_t), sch = skb_header_pointer(skb, ihl + sizeof(sctp_sctphdr_t),
sizeof(_sctpch), &_sctpch); sizeof(_sctpch), &_sctpch);
if (sch == NULL) if (sch == NULL)
return 0; return;
chunk_type = sch->type; chunk_type = sch->type;
/* /*
...@@ -993,21 +993,15 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, ...@@ -993,21 +993,15 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
cp->timeout = pd->timeout_table[cp->state = next_state]; cp->timeout = pd->timeout_table[cp->state = next_state];
else /* What to do ? */ else /* What to do ? */
cp->timeout = sctp_timeouts[cp->state = next_state]; cp->timeout = sctp_timeouts[cp->state = next_state];
return 1;
} }
static int static void
sctp_state_transition(struct ip_vs_conn *cp, int direction, sctp_state_transition(struct ip_vs_conn *cp, int direction,
const struct sk_buff *skb, struct ip_vs_proto_data *pd) const struct sk_buff *skb, struct ip_vs_proto_data *pd)
{ {
int ret = 0;
spin_lock(&cp->lock); spin_lock(&cp->lock);
ret = set_sctp_state(pd, cp, direction, skb); set_sctp_state(pd, cp, direction, skb);
spin_unlock(&cp->lock); spin_unlock(&cp->lock);
return ret;
} }
static inline __u16 sctp_app_hashkey(__be16 port) static inline __u16 sctp_app_hashkey(__be16 port)
......
...@@ -546,7 +546,7 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, ...@@ -546,7 +546,7 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
/* /*
* Handle state transitions * Handle state transitions
*/ */
static int static void
tcp_state_transition(struct ip_vs_conn *cp, int direction, tcp_state_transition(struct ip_vs_conn *cp, int direction,
const struct sk_buff *skb, const struct sk_buff *skb,
struct ip_vs_proto_data *pd) struct ip_vs_proto_data *pd)
...@@ -561,13 +561,11 @@ tcp_state_transition(struct ip_vs_conn *cp, int direction, ...@@ -561,13 +561,11 @@ tcp_state_transition(struct ip_vs_conn *cp, int direction,
th = skb_header_pointer(skb, ihl, sizeof(_tcph), &_tcph); th = skb_header_pointer(skb, ihl, sizeof(_tcph), &_tcph);
if (th == NULL) if (th == NULL)
return 0; return;
spin_lock(&cp->lock); spin_lock(&cp->lock);
set_tcp_state(pd, cp, direction, th); set_tcp_state(pd, cp, direction, th);
spin_unlock(&cp->lock); spin_unlock(&cp->lock);
return 1;
} }
static inline __u16 tcp_app_hashkey(__be16 port) static inline __u16 tcp_app_hashkey(__be16 port)
......
...@@ -454,18 +454,17 @@ static const char * udp_state_name(int state) ...@@ -454,18 +454,17 @@ static const char * udp_state_name(int state)
return udp_state_name_table[state] ? udp_state_name_table[state] : "?"; return udp_state_name_table[state] ? udp_state_name_table[state] : "?";
} }
static int static void
udp_state_transition(struct ip_vs_conn *cp, int direction, udp_state_transition(struct ip_vs_conn *cp, int direction,
const struct sk_buff *skb, const struct sk_buff *skb,
struct ip_vs_proto_data *pd) struct ip_vs_proto_data *pd)
{ {
if (unlikely(!pd)) { if (unlikely(!pd)) {
pr_err("UDP no ns data\n"); pr_err("UDP no ns data\n");
return 0; return;
} }
cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL]; cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL];
return 1;
} }
static void __udp_init(struct net *net, struct ip_vs_proto_data *pd) static void __udp_init(struct net *net, struct ip_vs_proto_data *pd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment