diff options
author | Simon Horman <horms@verge.net.au> | 2011-09-16 01:11:49 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-11-01 04:19:33 -0400 |
commit | 4a516f1108070db94dbfc88c80b8b6942915f1f2 (patch) | |
tree | 303ea182d96d15edb9a06cd2f5bbf157c42b7e81 /net | |
parent | 3c2de2ae028d2325a3f4fa47a43e099d6049194d (diff) |
ipvs: Remove unused return value of protocol state transitions
Acked-by: Julian Anastasov <ja@ssi.bg>
Acked-by Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_core.c | 13 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_proto_sctp.c | 14 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_proto_tcp.c | 6 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_proto_udp.c | 5 |
4 files changed, 14 insertions, 24 deletions
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index 4f77bb16d22a..00ea1ad00c04 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c | |||
@@ -188,14 +188,13 @@ ip_vs_conn_stats(struct ip_vs_conn *cp, struct ip_vs_service *svc) | |||
188 | } | 188 | } |
189 | 189 | ||
190 | 190 | ||
191 | static inline int | 191 | static inline void |
192 | ip_vs_set_state(struct ip_vs_conn *cp, int direction, | 192 | ip_vs_set_state(struct ip_vs_conn *cp, int direction, |
193 | const struct sk_buff *skb, | 193 | const struct sk_buff *skb, |
194 | struct ip_vs_proto_data *pd) | 194 | struct ip_vs_proto_data *pd) |
195 | { | 195 | { |
196 | if (unlikely(!pd->pp->state_transition)) | 196 | if (likely(pd->pp->state_transition)) |
197 | return 0; | 197 | pd->pp->state_transition(cp, direction, skb, pd); |
198 | return pd->pp->state_transition(cp, direction, skb, pd); | ||
199 | } | 198 | } |
200 | 199 | ||
201 | static inline int | 200 | static inline int |
@@ -557,7 +556,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | |||
557 | ip_vs_in_stats(cp, skb); | 556 | ip_vs_in_stats(cp, skb); |
558 | 557 | ||
559 | /* set state */ | 558 | /* set state */ |
560 | cs = ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd); | 559 | ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd); |
561 | 560 | ||
562 | /* transmit the first SYN packet */ | 561 | /* transmit the first SYN packet */ |
563 | ret = cp->packet_xmit(skb, cp, pd->pp); | 562 | 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 | struct ip_vs_protocol *pp; | 1489 | struct ip_vs_protocol *pp; |
1491 | struct ip_vs_proto_data *pd; | 1490 | struct ip_vs_proto_data *pd; |
1492 | struct ip_vs_conn *cp; | 1491 | struct ip_vs_conn *cp; |
1493 | int ret, restart, pkts; | 1492 | int ret, pkts; |
1494 | struct netns_ipvs *ipvs; | 1493 | struct netns_ipvs *ipvs; |
1495 | 1494 | ||
1496 | /* Already marked as IPVS request or reply? */ | 1495 | /* Already marked as IPVS request or reply? */ |
@@ -1591,7 +1590,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) | |||
1591 | } | 1590 | } |
1592 | 1591 | ||
1593 | ip_vs_in_stats(cp, skb); | 1592 | ip_vs_in_stats(cp, skb); |
1594 | restart = ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd); | 1593 | ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd); |
1595 | if (cp->packet_xmit) | 1594 | if (cp->packet_xmit) |
1596 | ret = cp->packet_xmit(skb, cp, pp); | 1595 | ret = cp->packet_xmit(skb, cp, pp); |
1597 | /* do not touch skb anymore */ | 1596 | /* do not touch skb anymore */ |
diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c index d12ed53ec95f..1fbf7a2816f5 100644 --- a/net/netfilter/ipvs/ip_vs_proto_sctp.c +++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c | |||
@@ -906,7 +906,7 @@ static const char *sctp_state_name(int state) | |||
906 | return "?"; | 906 | return "?"; |
907 | } | 907 | } |
908 | 908 | ||
909 | static inline int | 909 | static inline void |
910 | set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, | 910 | set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, |
911 | int direction, const struct sk_buff *skb) | 911 | int direction, const struct sk_buff *skb) |
912 | { | 912 | { |
@@ -924,7 +924,7 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, | |||
924 | sch = skb_header_pointer(skb, ihl + sizeof(sctp_sctphdr_t), | 924 | sch = skb_header_pointer(skb, ihl + sizeof(sctp_sctphdr_t), |
925 | sizeof(_sctpch), &_sctpch); | 925 | sizeof(_sctpch), &_sctpch); |
926 | if (sch == NULL) | 926 | if (sch == NULL) |
927 | return 0; | 927 | return; |
928 | 928 | ||
929 | chunk_type = sch->type; | 929 | chunk_type = sch->type; |
930 | /* | 930 | /* |
@@ -993,21 +993,15 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, | |||
993 | cp->timeout = pd->timeout_table[cp->state = next_state]; | 993 | cp->timeout = pd->timeout_table[cp->state = next_state]; |
994 | else /* What to do ? */ | 994 | else /* What to do ? */ |
995 | cp->timeout = sctp_timeouts[cp->state = next_state]; | 995 | cp->timeout = sctp_timeouts[cp->state = next_state]; |
996 | |||
997 | return 1; | ||
998 | } | 996 | } |
999 | 997 | ||
1000 | static int | 998 | static void |
1001 | sctp_state_transition(struct ip_vs_conn *cp, int direction, | 999 | sctp_state_transition(struct ip_vs_conn *cp, int direction, |
1002 | const struct sk_buff *skb, struct ip_vs_proto_data *pd) | 1000 | const struct sk_buff *skb, struct ip_vs_proto_data *pd) |
1003 | { | 1001 | { |
1004 | int ret = 0; | ||
1005 | |||
1006 | spin_lock(&cp->lock); | 1002 | spin_lock(&cp->lock); |
1007 | ret = set_sctp_state(pd, cp, direction, skb); | 1003 | set_sctp_state(pd, cp, direction, skb); |
1008 | spin_unlock(&cp->lock); | 1004 | spin_unlock(&cp->lock); |
1009 | |||
1010 | return ret; | ||
1011 | } | 1005 | } |
1012 | 1006 | ||
1013 | static inline __u16 sctp_app_hashkey(__be16 port) | 1007 | static inline __u16 sctp_app_hashkey(__be16 port) |
diff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c index c0cc341b840d..ef8641f7af83 100644 --- a/net/netfilter/ipvs/ip_vs_proto_tcp.c +++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c | |||
@@ -546,7 +546,7 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, | |||
546 | /* | 546 | /* |
547 | * Handle state transitions | 547 | * Handle state transitions |
548 | */ | 548 | */ |
549 | static int | 549 | static void |
550 | tcp_state_transition(struct ip_vs_conn *cp, int direction, | 550 | tcp_state_transition(struct ip_vs_conn *cp, int direction, |
551 | const struct sk_buff *skb, | 551 | const struct sk_buff *skb, |
552 | struct ip_vs_proto_data *pd) | 552 | struct ip_vs_proto_data *pd) |
@@ -561,13 +561,11 @@ tcp_state_transition(struct ip_vs_conn *cp, int direction, | |||
561 | 561 | ||
562 | th = skb_header_pointer(skb, ihl, sizeof(_tcph), &_tcph); | 562 | th = skb_header_pointer(skb, ihl, sizeof(_tcph), &_tcph); |
563 | if (th == NULL) | 563 | if (th == NULL) |
564 | return 0; | 564 | return; |
565 | 565 | ||
566 | spin_lock(&cp->lock); | 566 | spin_lock(&cp->lock); |
567 | set_tcp_state(pd, cp, direction, th); | 567 | set_tcp_state(pd, cp, direction, th); |
568 | spin_unlock(&cp->lock); | 568 | spin_unlock(&cp->lock); |
569 | |||
570 | return 1; | ||
571 | } | 569 | } |
572 | 570 | ||
573 | static inline __u16 tcp_app_hashkey(__be16 port) | 571 | static inline __u16 tcp_app_hashkey(__be16 port) |
diff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c index f1282cbe6fe3..f4b7262896bb 100644 --- a/net/netfilter/ipvs/ip_vs_proto_udp.c +++ b/net/netfilter/ipvs/ip_vs_proto_udp.c | |||
@@ -454,18 +454,17 @@ static const char * udp_state_name(int state) | |||
454 | return udp_state_name_table[state] ? udp_state_name_table[state] : "?"; | 454 | return udp_state_name_table[state] ? udp_state_name_table[state] : "?"; |
455 | } | 455 | } |
456 | 456 | ||
457 | static int | 457 | static void |
458 | udp_state_transition(struct ip_vs_conn *cp, int direction, | 458 | udp_state_transition(struct ip_vs_conn *cp, int direction, |
459 | const struct sk_buff *skb, | 459 | const struct sk_buff *skb, |
460 | struct ip_vs_proto_data *pd) | 460 | struct ip_vs_proto_data *pd) |
461 | { | 461 | { |
462 | if (unlikely(!pd)) { | 462 | if (unlikely(!pd)) { |
463 | pr_err("UDP no ns data\n"); | 463 | pr_err("UDP no ns data\n"); |
464 | return 0; | 464 | return; |
465 | } | 465 | } |
466 | 466 | ||
467 | cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL]; | 467 | cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL]; |
468 | return 1; | ||
469 | } | 468 | } |
470 | 469 | ||
471 | static void __udp_init(struct net *net, struct ip_vs_proto_data *pd) | 470 | static void __udp_init(struct net *net, struct ip_vs_proto_data *pd) |