Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1526?usp=email
to review the following change.
Change subject: ssl: Avoid sign-compare warning in should_trigger_renegotiation
......................................................................
ssl: Avoid sign-compare warning in should_trigger_renegotiation
Check that the value is positive and then cast it
to counter_type.
Change-Id: I701452496bb47c58b9728b08104dd5cb7823a94f
Signed-off-by: Frank Lichtenheld <[email protected]>
---
M src/openvpn/ssl.c
1 file changed, 2 insertions(+), 11 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/26/1526/1
diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index aac31c2..b053dbf 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -2909,11 +2909,6 @@
return true;
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-compare"
-#endif
-
/**
* Determines if a renegotiation should be triggerred based on the various
* factors that can trigger one
@@ -2929,13 +2924,13 @@
}
/* Byte limit */
- if (session->opt->renegotiate_bytes > 0 && ks->n_bytes >=
session->opt->renegotiate_bytes)
+ if (session->opt->renegotiate_bytes > 0 && ks->n_bytes >=
(counter_type)session->opt->renegotiate_bytes)
{
return true;
}
/* Packet limit */
- if (session->opt->renegotiate_packets && ks->n_packets >=
session->opt->renegotiate_packets)
+ if (session->opt->renegotiate_packets > 0 && ks->n_packets >=
(counter_type)session->opt->renegotiate_packets)
{
return true;
}
@@ -2993,10 +2988,6 @@
return false;
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
/*
* This is the primary routine for processing TLS stuff inside the
* the main event loop. When this routine exits
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1526?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I701452496bb47c58b9728b08104dd5cb7823a94f
Gerrit-Change-Number: 1526
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel