Subject: Re: [PATCH 2/2] ipvs: Fix reuse connection if real server is dead

From: Sergei Shtylyov <[email-masked]>
Date: Wed, 22 May 2013 22:11:35 +0400

Hello.

On 22-05-2013 9:56, Simon Horman wrote:

> From: Grzegorz Lyczba <[email-masked]>

> Expire cached connection for new TCP/SCTP connection if real server is down

> Signed-off-by: Grzegorz Lyczba <[email-masked]>
> Acked-by Hans Schillstrom <[email-masked]>

    Missing :.

> Signed-off-by: Simon Horman <[email-masked]>
> ---
>   net/netfilter/ipvs/ip_vs_core.c | 36 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 36 insertions(+)

> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index 085b588..7967d12 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1001,6 +1001,33 @@ static inline int is_tcp_reset(const struct sk_buff *skb, int nh_len)
>   	return th->rst;
>   }
>
> +static inline bool is_new_conn(const struct sk_buff *skb,
> +			       struct ip_vs_iphdr *iph)
> +{
> +	switch (iph->protocol) {
> +	case IPPROTO_TCP: {
> +		struct tcphdr _tcph, *th;
> +
> +		th = skb_header_pointer(skb, iph->len, sizeof(_tcph), &_tcph);
> +		if (th == NULL)
> +			return false;
> +		return th->syn;
> +	}
> +	case IPPROTO_SCTP: {
> +		sctp_chunkhdr_t *sch, schunk;
> +
> +		sch = skb_header_pointer(skb, iph->len + sizeof(sctp_sctphdr_t),
> +				sizeof(schunk), &schunk);

    This line should be aligned under the next character after (.

> +		if (sch == NULL)
> +			return false;
> +		return (sch->type == SCTP_CID_INIT);

    () not needed.

> +	}
> +	default:
> +		return false;
> +	}
> +}
> +
> +

    Too many empty lines?

WBR, Sergei