Re: [PATCH nft] payload: fix transport matching with no network layer info in bridge family

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26.06, Pablo Neira Ayuso wrote:
>  # nft --debug=netlink add rule bridge filter input tcp dport 22
>  bridge filter input
>   [ meta load l4proto => reg 1 ]
>   [ cmp eq reg 1 0x00000006 ]
>   [ payload load 2b @ transport header + 2 => reg 1 ]
>   [ cmp eq reg 1 0x00001600 ]
> 
> Reported-by: Eric Leblond <eric@xxxxxxxxx>
> Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
> ---
>  src/payload.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/payload.c b/src/payload.c
> index 08578fd..e67ef17 100644
> --- a/src/payload.c
> +++ b/src/payload.c
> @@ -219,6 +219,9 @@ int payload_gen_dependency(struct eval_ctx *ctx, const struct expr *expr,
>  			case PROTO_BASE_LL_HDR:
>  				desc = &proto_eth;
>  				break;
> +			case PROTO_BASE_TRANSPORT_HDR:
> +				desc = &proto_inet_service;
> +				break;

Just a very minor issue - the switch statement for NFPROTO_INET
just above uses the opposite ordering. Would increase readbility
to use the same for both, and I actually LL then TRANSPORT.

>  			default:
>  				break;
>  			}
> -- 
> 1.7.10.4
> 
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux