History

netfilter: nft_ct: make l3 protocol field optional for timeout object

If l3 protocol value is not specified for ct timeout object then use the value from nft_ctx protocol family.

Harsha Sharma committed 8 years ago

Commit 3206c511 parent 1bfc2bc1 file · +4 −3Browse files

Unified · Split

net/netfilter/nft_ct.c+4−3
@@ -832,12 +832,13 @@ static int nft_ct_timeout_obj_init(const struct nft_ctx *ctx, · 831 unmodified lines
832832 __u8 l4num;
833833 int ret;
834834
835− if (!tb[NFTA_CT_TIMEOUT_L3PROTO] ||
836− !tb[NFTA_CT_TIMEOUT_L4PROTO] ||
835+ if (!tb[NFTA_CT_TIMEOUT_L4PROTO] ||
837836 !tb[NFTA_CT_TIMEOUT_DATA])
838837 return -EINVAL;
839838
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+
841842 l4num = nla_get_u8(tb[NFTA_CT_TIMEOUT_L4PROTO]);
842843 priv->l4proto = l4num;
843844