mirror of https://gitee.com/openkylin/linux.git
[NETFILTER]: ctnetlink: Fix dumping of helper name
Properly dump the helper name instead of internal kernel data. Based on patch by Marcus Sundberg <marcus@ingate.com>. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e7be6994ec
commit
a9b305c4e5
|
@ -131,6 +131,4 @@ enum ctattr_help {
|
||||||
};
|
};
|
||||||
#define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
|
#define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
|
||||||
|
|
||||||
#define CTA_HELP_MAXNAMESIZE 32
|
|
||||||
|
|
||||||
#endif /* _IPCONNTRACK_NETLINK_H */
|
#endif /* _IPCONNTRACK_NETLINK_H */
|
||||||
|
|
|
@ -161,7 +161,7 @@ ctnetlink_dump_helpinfo(struct sk_buff *skb, const struct ip_conntrack *ct)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
nest_helper = NFA_NEST(skb, CTA_HELP);
|
nest_helper = NFA_NEST(skb, CTA_HELP);
|
||||||
NFA_PUT(skb, CTA_HELP_NAME, CTA_HELP_MAXNAMESIZE, &ct->helper->name);
|
NFA_PUT(skb, CTA_HELP_NAME, strlen(ct->helper->name), ct->helper->name);
|
||||||
|
|
||||||
if (ct->helper->to_nfattr)
|
if (ct->helper->to_nfattr)
|
||||||
ct->helper->to_nfattr(skb, ct);
|
ct->helper->to_nfattr(skb, ct);
|
||||||
|
|
Loading…
Reference in New Issue