aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/netfilter/nft_ct.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index ea737fd789e8..5c0de704bad5 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -880,22 +880,26 @@ static int nft_ct_helper_obj_dump(struct sk_buff *skb,
880 struct nft_object *obj, bool reset) 880 struct nft_object *obj, bool reset)
881{ 881{
882 const struct nft_ct_helper_obj *priv = nft_obj_data(obj); 882 const struct nft_ct_helper_obj *priv = nft_obj_data(obj);
883 const struct nf_conntrack_helper *helper = priv->helper4; 883 const struct nf_conntrack_helper *helper;
884 u16 family; 884 u16 family;
885 885
886 if (priv->helper4 && priv->helper6) {
887 family = NFPROTO_INET;
888 helper = priv->helper4;
889 } else if (priv->helper6) {
890 family = NFPROTO_IPV6;
891 helper = priv->helper6;
892 } else {
893 family = NFPROTO_IPV4;
894 helper = priv->helper4;
895 }
896
886 if (nla_put_string(skb, NFTA_CT_HELPER_NAME, helper->name)) 897 if (nla_put_string(skb, NFTA_CT_HELPER_NAME, helper->name))
887 return -1; 898 return -1;
888 899
889 if (nla_put_u8(skb, NFTA_CT_HELPER_L4PROTO, priv->l4proto)) 900 if (nla_put_u8(skb, NFTA_CT_HELPER_L4PROTO, priv->l4proto))
890 return -1; 901 return -1;
891 902
892 if (priv->helper4 && priv->helper6)
893 family = NFPROTO_INET;
894 else if (priv->helper6)
895 family = NFPROTO_IPV6;
896 else
897 family = NFPROTO_IPV4;
898
899 if (nla_put_be16(skb, NFTA_CT_HELPER_L3PROTO, htons(family))) 903 if (nla_put_be16(skb, NFTA_CT_HELPER_L3PROTO, htons(family)))
900 return -1; 904 return -1;
901 905