Gert Doering has uploaded a new patch set (#2) to the change originally created 
by Frank Lichtenheld. ( https://gerrit.openvpn.net/c/openvpn/+/2378?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by Răzvan Cojocaru


Change subject: vlan: Avoid sign conversion warnings
......................................................................

vlan: Avoid sign conversion warnings

Since vid is limited by OPENVPN_8021Q_MASK_VID these
casts are always safe. They are required since we
use -1 for error reporting.

Change-Id: I86381c949009cf6195255509bd3a9130cfe715ba
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Razvan Cojocaru <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2378
Message-Id: <[email protected]>
URL: 
https://www.mail-archive.com/[email protected]/msg42271.html
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpn/vlan.c
1 file changed, 3 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/78/2378/2

diff --git a/src/openvpn/vlan.c b/src/openvpn/vlan.c
index d44dac1..02a9bbe 100644
--- a/src/openvpn/vlan.c
+++ b/src/openvpn/vlan.c
@@ -56,11 +56,6 @@
         (hdr->pcp_cfi_vid & ~OPENVPN_8021Q_MASK_VID) | (htons(vid) & 
OPENVPN_8021Q_MASK_VID);
 }

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
-
 /*
  * vlan_decapsulate - remove 802.1q header and return VID
  *
@@ -110,7 +105,7 @@
         msg(D_VLAN_DEBUG, "assuming pvid for frame without vlan-tag, pvid: %u 
(proto/len 0x%04x)",
             c->options.vlan_pvid, ntohs(ethhdr->proto));

-        return c->options.vlan_pvid;
+        return (int16_t)c->options.vlan_pvid;
     }

     /* tagged frame */
@@ -145,7 +140,7 @@
             if (vid == 0)
             {
                 /* return the global VID for priority-tagged frames */
-                return c->options.vlan_pvid;
+                return (int16_t)c->options.vlan_pvid;
             }

             /* here we have a proper VLAN tagged frame: perform decapsulation
@@ -167,7 +162,7 @@
             /* restore the inner protocol value */
             ethhdr->proto = proto;

-            return vid;
+            return (int16_t)vid;
     }

 drop:
@@ -175,10 +170,6 @@
     return -1;
 }

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 /*
  * vlan_encapsulate - add 802.1q header and set the context related VID
  *

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I86381c949009cf6195255509bd3a9130cfe715ba
Gerrit-Change-Number: 2378
Gerrit-PatchSet: 2
Gerrit-Owner: Frank Lichtenheld <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Răzvan Cojocaru <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to