[NETFILTER]: ctnetlink: check for status attribute existence on conntrack creation
Check that status flags are available in the netlink message received to create a new conntrack. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Родитель
1b683b5512
Коммит
bbb3357d14
|
@ -945,9 +945,11 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
|
||||||
ct->timeout.expires = jiffies + ct->timeout.expires * HZ;
|
ct->timeout.expires = jiffies + ct->timeout.expires * HZ;
|
||||||
ct->status |= IPS_CONFIRMED;
|
ct->status |= IPS_CONFIRMED;
|
||||||
|
|
||||||
|
if (cda[CTA_STATUS-1]) {
|
||||||
err = ctnetlink_change_status(ct, cda);
|
err = ctnetlink_change_status(ct, cda);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
if (cda[CTA_PROTOINFO-1]) {
|
if (cda[CTA_PROTOINFO-1]) {
|
||||||
err = ctnetlink_change_protoinfo(ct, cda);
|
err = ctnetlink_change_protoinfo(ct, cda);
|
||||||
|
|
|
@ -963,9 +963,11 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
|
||||||
ct->timeout.expires = jiffies + ct->timeout.expires * HZ;
|
ct->timeout.expires = jiffies + ct->timeout.expires * HZ;
|
||||||
ct->status |= IPS_CONFIRMED;
|
ct->status |= IPS_CONFIRMED;
|
||||||
|
|
||||||
|
if (cda[CTA_STATUS-1]) {
|
||||||
err = ctnetlink_change_status(ct, cda);
|
err = ctnetlink_change_status(ct, cda);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
if (cda[CTA_PROTOINFO-1]) {
|
if (cda[CTA_PROTOINFO-1]) {
|
||||||
err = ctnetlink_change_protoinfo(ct, cda);
|
err = ctnetlink_change_protoinfo(ct, cda);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче