On Wed, 2016-08-24 at 03:06 +0900, Lorenzo Colitti wrote:
> This simplifies the code a bit and also allows inet_diag_bc_audit
> to send to userspace an error that isn't EINVAL.
> 
> Signed-off-by: Lorenzo Colitti <lore...@google.com>
> ---
>  net/ipv4/inet_diag.c | 35 ++++++++++++++++++++++++-----------
>  1 file changed, 24 insertions(+), 11 deletions(-)
> 
> diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
> index 38c2c47..a835f94 100644
> --- a/net/ipv4/inet_diag.c
> +++ b/net/ipv4/inet_diag.c
> @@ -706,10 +706,23 @@ static bool valid_port_comparison(const struct 
> inet_diag_bc_op *op,
>       return true;
>  }
>  
> -static int inet_diag_bc_audit(const void *bytecode, int bytecode_len)
> +static bool valid_markcond(const struct inet_diag_bc_op *op, int len,
> +                        int *min_len)
>  {
> -     const void *bc = bytecode;
> -     int  len = bytecode_len;
> +     *min_len += sizeof(struct inet_diag_markcond);
> +     return len >= *min_len;
> +}

I do not see how this can compile, since you introduce "struct
inet_diag_markcond" in the following patch ?



Reply via email to