]> The Tcpdump Group git mirrors - libpcap/commitdiff
Merge two identical cases in gen_gateway(). 1465/head
authorDenis Ovsienko <[email protected]>
Sat, 15 Feb 2025 20:57:01 +0000 (20:57 +0000)
committerDenis Ovsienko <[email protected]>
Sun, 16 Feb 2025 00:42:50 +0000 (00:42 +0000)
The filter tests should make is easier to refactor this code.

gencode.c

index 3d76d215459598f74ea63d384688778b9f1c83bb..8c12099a03224f73afe567aeec7e15d7c69d8fa6 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -5480,17 +5480,16 @@ gen_gateway(compiler_state_t *cstate, const u_char *eaddr,
                case DLT_PPI:
                        b0 = gen_wlanhostop(cstate, eaddr, Q_OR);
                        break;
+               case DLT_IP_OVER_FC:
+                       b0 = gen_ipfchostop(cstate, eaddr, Q_OR);
+                       break;
                case DLT_SUNATM:
                        /*
                         * This is LLC-multiplexed traffic; if it were
                         * LANE, cstate->linktype would have been set to
                         * DLT_EN10MB.
                         */
-                       bpf_error(cstate,
-                           "'gateway' supported only on ethernet/FDDI/token ring/802.11/ATM LANE/Fibre Channel");
-               case DLT_IP_OVER_FC:
-                       b0 = gen_ipfchostop(cstate, eaddr, Q_OR);
-                       break;
+                        /* FALLTHROUGH */
                default:
                        bpf_error(cstate,
                            "'gateway' supported only on ethernet/FDDI/token ring/802.11/ATM LANE/Fibre Channel");