Quoting Jason Xing (2024-04-09 12:09:30)
>         void            (*send_reset)(const struct sock *sk,
> -                                     struct sk_buff *skb);
> +                                     struct sk_buff *skb,
> +                                     int reason);

I get that 'int' is used instead of 'enum sk_rst_reason' to allow
passing drop reasons too without casting, but that makes understanding
what should be 'reason' harder. Eg. when looking at the code or when
using BTF (to then install debugging probes with BPF) this is not
obvious.

A similar approach could be done as the one used for drop reasons: enum
skb_drop_reason is used for parameters (eg. kfree_skb_reason) but other
valid values (subsystem drop reasons) can be used too if casted (to
u32). We could use 'enum sk_rst_reason' and cast the other values. WDYT?

Thanks,
Antoine

Reply via email to