If l3 protocol value is not specified for ct timeout object then use the value from nft_ctx protocol family.
Unified · Split
| @@ -832,12 +832,13 @@ static int nft_ct_timeout_obj_init(const struct nft_ctx *ctx, · 831 unmodified lines | ||
| 832 | 832 | __u8 l4num; |
| 833 | 833 | int ret; |
| 834 | 834 | |
| 835 | − if (!tb[NFTA_CT_TIMEOUT_L3PROTO] || | |
| 836 | − !tb[NFTA_CT_TIMEOUT_L4PROTO] || | |
| 835 | + if (!tb[NFTA_CT_TIMEOUT_L4PROTO] || | |
| 837 | 836 | !tb[NFTA_CT_TIMEOUT_DATA]) |
| 838 | 837 | return -EINVAL; |
| 839 | 838 | |
| 840 | − l3num = ntohs(nla_get_be16(tb[NFTA_CT_TIMEOUT_L3PROTO])); | |
| 839 | + if (tb[NFTA_CT_TIMEOUT_L3PROTO]) | |
| 840 | + l3num = ntohs(nla_get_be16(tb[NFTA_CT_TIMEOUT_L3PROTO])); | |
| 841 | + | |
| 841 | 842 | l4num = nla_get_u8(tb[NFTA_CT_TIMEOUT_L4PROTO]); |
| 842 | 843 | priv->l4proto = l4num; |
| 843 | 844 | |