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
832 __u8 l4num;832 __u8 l4num;
833 int ret;833 int ret;
834 834
835 if (!tb[NFTA_CT_TIMEOUT_L3PROTO] ||835 if (!tb[NFTA_CT_TIMEOUT_L4PROTO] ||
836 !tb[NFTA_CT_TIMEOUT_L4PROTO] ||
837 !tb[NFTA_CT_TIMEOUT_DATA])836 !tb[NFTA_CT_TIMEOUT_DATA])
838 return -EINVAL;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 l4num = nla_get_u8(tb[NFTA_CT_TIMEOUT_L4PROTO]);842 l4num = nla_get_u8(tb[NFTA_CT_TIMEOUT_L4PROTO]);
842 priv->l4proto = l4num;843 priv->l4proto = l4num;
843 844