[Openvpn-devel] [S] Change in openvpn[master]: Make pull_permission_mask return uint64_t

"plaisthos \(Code Review\) via Openvpn-devel" <[email protected]>
Newsgroups net.sourceforge.lists.openvpn-devel
Message-ID <ef047db295d4088e3ec6cf35b131118789bd3cbb-EmailReplacePatchSet-HTML@gerrit.openvpn.net>
Attention is currently required from: plaisthos.

plaisthos has uploaded a new patch set (#2). ( http://gerrit.openvpn.net/c/openvpn/+/1851?usp=email )


Change subject: Make pull_permission_mask return uint64_t
......................................................................

Make pull_permission_mask return uint64_t

Commit 91fd9614 already change most of the instances for the
option flag to uint64_t but forgot to also adjust
pull_permission_mask.

Change-Id: Icd53745b242e0ca2943863d5b274b2a13b4419bd
Signed-off-by: Arne Schwabe <[email protected]>
---
M src/openvpn/init.c
M src/openvpn/init.h
M src/openvpn/options.h
M src/openvpn/push_util.c
M tests/unit_tests/openvpn/test_push_update_msg.c
5 files changed, 13 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/51/1851/2

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index fa62cdd..66bae34 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -2514,13 +2514,13 @@
 /*
  * These are the option categories which will be accepted by pull.
  */
-unsigned int
+uint64_t
 pull_permission_mask(const struct context *c)
 {
-    unsigned int flags = OPT_P_UP | OPT_P_ROUTE_EXTRAS | OPT_P_SOCKBUF | OPT_P_SOCKFLAGS
-                         | OPT_P_SETENV | OPT_P_SHAPER | OPT_P_TIMER | OPT_P_COMP | OPT_P_PERSIST
-                         | OPT_P_MESSAGES | OPT_P_EXPLICIT_NOTIFY | OPT_P_ECHO | OPT_P_PULL_MODE
-                         | OPT_P_PEER_ID | OPT_P_NCP | OPT_P_PUSH_MTU;
+    uint64_t flags = OPT_P_UP | OPT_P_ROUTE_EXTRAS | OPT_P_SOCKBUF | OPT_P_SOCKFLAGS
+                     | OPT_P_SETENV | OPT_P_SHAPER | OPT_P_TIMER | OPT_P_COMP | OPT_P_PERSIST
+                     | OPT_P_MESSAGES | OPT_P_EXPLICIT_NOTIFY | OPT_P_ECHO | OPT_P_PULL_MODE
+                     | OPT_P_PEER_ID | OPT_P_NCP | OPT_P_PUSH_MTU;
 
     if (!c->options.route_nopull)
     {
diff --git a/src/openvpn/init.h b/src/openvpn/init.h
index 9d5050d..ce8f74e 100644
--- a/src/openvpn/init.h
+++ b/src/openvpn/init.h
@@ -89,7 +89,7 @@
  */
 bool do_update(struct context *c, uint64_t option_types_found);
 
-unsigned int pull_permission_mask(const struct context *c);
+uint64_t pull_permission_mask(const struct context *c);
 
 const char *format_common_name(struct context *c, struct gc_arena *gc);
 
diff --git a/src/openvpn/options.h b/src/openvpn/options.h
index 0fd505a..e93b05b 100644
--- a/src/openvpn/options.h
+++ b/src/openvpn/options.h
@@ -761,7 +761,7 @@
 #define OPT_P_PUSH_MTU        (1u << 30)
 #define OPT_P_ROUTE_TABLE     (1u << 31)
 
-#define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE))
+#define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE | OPT_P_PEER_ID | 0x0ull))
 
 #define PULL_DEFINED(opt) ((opt)->pull)
 
diff --git a/src/openvpn/push_util.c b/src/openvpn/push_util.c
index c927f26..fcc5411 100644
--- a/src/openvpn/push_util.c
+++ b/src/openvpn/push_util.c
@@ -185,7 +185,7 @@
          */
         struct buffer tmp_msg = e->buf;
         buf_string_compare_advance(&tmp_msg, push_update_cmd);
-        unsigned int permission_mask = pull_permission_mask(c);
+        uint64_t permission_mask = pull_permission_mask(c);
         if (process_push_update(c, &o, permission_mask, &option_types_found, &tmp_msg, true) == PUSH_MSG_ERROR)
         {
             msg(M_WARN, "Failed to process push update message sent to client ID: %u", c->c2.tls_multi->rx_peer_id);
diff --git a/tests/unit_tests/openvpn/test_push_update_msg.c b/tests/unit_tests/openvpn/test_push_update_msg.c
index 9cb791b..2653749 100644
--- a/tests/unit_tests/openvpn/test_push_update_msg.c
+++ b/tests/unit_tests/openvpn/test_push_update_msg.c
@@ -20,13 +20,13 @@
     msg(M_WARN, "Offending option received from server");
 }
 
-unsigned int
+uint64_t
 pull_permission_mask(const struct context *c)
 {
-    unsigned int flags = OPT_P_UP | OPT_P_ROUTE_EXTRAS | OPT_P_SOCKBUF | OPT_P_SOCKFLAGS
-                         | OPT_P_SETENV | OPT_P_SHAPER | OPT_P_TIMER | OPT_P_COMP | OPT_P_PERSIST
-                         | OPT_P_MESSAGES | OPT_P_EXPLICIT_NOTIFY | OPT_P_ECHO | OPT_P_PULL_MODE
-                         | OPT_P_PEER_ID | OPT_P_NCP | OPT_P_PUSH_MTU | OPT_P_ROUTE | OPT_P_DHCPDNS;
+    uint64_t flags = OPT_P_UP | OPT_P_ROUTE_EXTRAS | OPT_P_SOCKBUF | OPT_P_SOCKFLAGS
+                     | OPT_P_SETENV | OPT_P_SHAPER | OPT_P_TIMER | OPT_P_COMP | OPT_P_PERSIST
+                     | OPT_P_MESSAGES | OPT_P_EXPLICIT_NOTIFY | OPT_P_ECHO | OPT_P_PULL_MODE
+                     | OPT_P_PEER_ID | OPT_P_NCP | OPT_P_PUSH_MTU | OPT_P_ROUTE | OPT_P_DHCPDNS;
     return flags;
 }
 

-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1851?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Icd53745b242e0ca2943863d5b274b2a13b4419bd
Gerrit-Change-Number: 1851
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: razvanc <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.