diff mbox series

[ovs-dev] conntrack: Fix Windows build due to ternary syntax extension.

Message ID 20241014100557.69392-1-pvalerio@redhat.com
State Accepted
Commit 4c5c1aa9f92fb018eddf5145a13a35864b650d99
Headers show
Series [ovs-dev] conntrack: Fix Windows build due to ternary syntax extension. | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Paolo Valerio Oct. 14, 2024, 10:05 a.m. UTC
From: Aaron Conole <aconole@redhat.com>

In the cited commit a ternary using syntax extension slipped in.

The extension allows omitting the second operand and it is not
supported by MSVC resulting in a build failure.

Fix it by simply specifying the second operand.

Fixes: b57c1da5c39a ("conntrack: Use a per zone default limit.")
Reported-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Aaron Conole <aconole@redhat.com>
[Paolo: added commit message]
Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
---
 lib/conntrack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eelco Chaudron Oct. 14, 2024, 10:26 a.m. UTC | #1
On 14 Oct 2024, at 12:05, Paolo Valerio wrote:

> From: Aaron Conole <aconole@redhat.com>
>
> In the cited commit a ternary using syntax extension slipped in.
>
> The extension allows omitting the second operand and it is not
> supported by MSVC resulting in a build failure.
>
> Fix it by simply specifying the second operand.
>
> Fixes: b57c1da5c39a ("conntrack: Use a per zone default limit.")
> Reported-by: Ilya Maximets <i.maximets@ovn.org>
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> [Paolo: added commit message]
> Signed-off-by: Paolo Valerio <pvalerio@redhat.com>

Thanks for submitting this patch. Ignore the robot message for now, I’ll fix it at commit time. Waiting for tests to complete.

Cheers,

Eelco
Eelco Chaudron Oct. 14, 2024, 11:10 a.m. UTC | #2
On 14 Oct 2024, at 12:26, Eelco Chaudron wrote:

> On 14 Oct 2024, at 12:05, Paolo Valerio wrote:
>
>> From: Aaron Conole <aconole@redhat.com>
>>
>> In the cited commit a ternary using syntax extension slipped in.
>>
>> The extension allows omitting the second operand and it is not
>> supported by MSVC resulting in a build failure.
>>
>> Fix it by simply specifying the second operand.
>>
>> Fixes: b57c1da5c39a ("conntrack: Use a per zone default limit.")
>> Reported-by: Ilya Maximets <i.maximets@ovn.org>
>> Signed-off-by: Aaron Conole <aconole@redhat.com>
>> [Paolo: added commit message]
>> Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
>
> Thanks for submitting this patch. Ignore the robot message for now, I’ll fix it at commit time. Waiting for tests to complete.
>
> Cheers,
>
> Eelco

Aaron and Paolo thanks for the patch, it has been applied to main.

//Eelco
diff mbox series

Patch

diff --git a/lib/conntrack.c b/lib/conntrack.c
index 0061a5636..f4b150bee 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -313,7 +313,7 @@  zone_limit_get_limit(struct conntrack *ct, struct conntrack_zone_limit *czl)
 
     if (limit == ZONE_LIMIT_CONN_DEFAULT) {
         atomic_read_relaxed(&ct->default_zone_limit, &limit);
-        limit = limit ? : -1;
+        limit = limit ? limit : -1;
     }
 
     return limit;