[Bridge] [PATCH][nf-next] netfilter: convert the proto argument from u8 to u16

Florian Westphal fw at strlen.de
Fri Feb 22 11:52:27 UTC 2019

Li RongQing <lirongqing at baidu.com> wrote:
> The proto in struct xt_match and struct xt_target is u16, when
> calling xt_check_target/match, their proto argument is u8,
> and will cause truncation, it is harmless to ip packet, since
> ip proto is u8
> if a L2 match/target has proto that is u16, will cause the check
> failure.

Yes, I don't see any ebtables matches/targets that set .proto though, so
no failure should happen in current kernel.

Otherwise, could you add an example where we hit a checkentry failure in

> +int xt_check_match(struct xt_mtchk_param *, unsigned int size, u_int16_t proto,
>  		   bool inv_proto);

I think you can use u16 instead of the old u_int16_t.

Other than that, this looks good to me, thanks.

More information about the Bridge mailing list