]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #12703 from donaldsharp/basic_babel
authorDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 30 Jan 2023 08:45:49 +0000 (10:45 +0200)
committerGitHub <noreply@github.com>
Mon, 30 Jan 2023 08:45:49 +0000 (10:45 +0200)
Basic babel

.github/workflows/freeze.yml [new file with mode: 0644]
lib/command.h
lib/frrscript.h
lib/grammar_sandbox_main.c
watchfrr/watchfrr.c
zebra/zebra_dplane.c
zebra/zebra_nhg.c

diff --git a/.github/workflows/freeze.yml b/.github/workflows/freeze.yml
new file mode 100644 (file)
index 0000000..f3506d0
--- /dev/null
@@ -0,0 +1,17 @@
+name: Warn before merging if a "freeze" label exists
+
+on:
+  pull_request_target:
+    types: [synchronize, opened, reopened, labeled, unlabeled]
+
+jobs:
+  freeze_warning:
+    if: ${{ contains(github.event.*.labels.*.name, 'freeze') }}
+    name: Warn before merging if a "freeze" label exists
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check for "freeze" label
+        run: |
+          echo "Pull request is labeled as 'freeze'"
+          echo "This workflow fails so that the pull request cannot be merged."
+          exit 1
index bce4fb9e1cea439422101029540c6de3487cbca1..8f5d96053cb10fdf1df07222516d8071225d8292 100644 (file)
@@ -619,9 +619,6 @@ extern void print_version(const char *);
 extern int cmd_banner_motd_file(const char *);
 extern void cmd_banner_motd_line(const char *line);
 
-/* struct host global, ick */
-extern struct host host;
-
 struct cmd_variable_handler {
        const char *tokenname, *varname;
        void (*completions)(vector out, struct cmd_token *token);
index 7fa01f70d1baf861c0a3b819c6e37f84f2b4f5ee..afaab66f1b16d1ef2a68eb491269e5257c979144 100644 (file)
@@ -34,7 +34,7 @@ extern "C" {
 #endif
 
 /* Forward declarations */
-extern struct zebra_dplane_ctx ctx;
+struct zebra_dplane_ctx;
 extern void lua_pushzebra_dplane_ctx(lua_State *L,
                                     const struct zebra_dplane_ctx *ctx);
 extern void lua_decode_zebra_dplane_ctx(lua_State *L, int idx,
index 6469b49262ba96b6d856888a15a10ba22ce585de..a7d6c51376adf9756f049385e278216a13357d82 100644 (file)
@@ -49,8 +49,8 @@ int main(int argc, char **argv)
 
        /* Library inits. */
        cmd_init(1);
-       host.name = strdup("test");
-       host.domainname = strdup("testdomainname");
+       cmd_hostname_set("test");
+       cmd_domainname_set("testdomainname");
 
        vty_init(master, true);
        lib_cmd_init();
index 4a3575ae75051b6719e5f65bf3b25dfbe2b3e822..2b0fec1b23d8dffb27bee4c1dd8396b26fd1824d 100644 (file)
@@ -941,13 +941,10 @@ static void phase_check(void)
                if (!IS_UP(gs.special))
                        break;
                zlog_info("Phased restart: %s is now up.", gs.special->name);
-               {
-                       struct daemon *dmn;
-                       for (dmn = gs.daemons; dmn; dmn = dmn->next) {
-                               if (dmn != gs.special)
-                                       run_job(&dmn->restart, "start",
-                                               gs.start_command, 1, 0);
-                       }
+               for (dmn = gs.daemons; dmn; dmn = dmn->next) {
+                       if (dmn != gs.special)
+                               run_job(&dmn->restart, "start",
+                                       gs.start_command, 1, 0);
                }
                gs.phase = PHASE_NONE;
                THREAD_OFF(gs.t_phase_hanging);
index 7db8fba95bfea3d5f06fb3e155e37ddf4b10aa7a..ef4cef65ca55c59bd0da228add6c623c4f7962db 100644 (file)
@@ -5551,9 +5551,7 @@ int dplane_show_provs_helper(struct vty *vty, bool detailed)
                        prov->dp_name, prov->dp_id, in, in_q, in_max,
                        out, out_q, out_max);
 
-               DPLANE_LOCK();
                prov = dplane_prov_list_next(&zdplane_info.dg_providers, prov);
-               DPLANE_UNLOCK();
        }
 
        return CMD_SUCCESS;
@@ -6592,9 +6590,7 @@ static bool dplane_work_pending(void)
                if (ctx != NULL)
                        break;
 
-               DPLANE_LOCK();
                prov = dplane_prov_list_next(&zdplane_info.dg_providers, prov);
-               DPLANE_UNLOCK();
        }
 
        if (ctx != NULL)
@@ -6822,9 +6818,7 @@ static void dplane_thread_loop(struct thread *event)
                                   counter, dplane_provider_get_name(prov));
 
                /* Locate next provider */
-               DPLANE_LOCK();
                prov = dplane_prov_list_next(&zdplane_info.dg_providers, prov);
-               DPLANE_UNLOCK();
        }
 
        /*
@@ -6968,9 +6962,7 @@ void zebra_dplane_start(void)
                        (prov->dp_start)(prov);
 
                /* Locate next provider */
-               DPLANE_LOCK();
                prov = dplane_prov_list_next(&zdplane_info.dg_providers, prov);
-               DPLANE_UNLOCK();
        }
 
        frr_pthread_run(zdplane_info.dg_pthread, NULL);
index 286cc0292dbae551ed8aecc30f71a1822175aa41..758fed7280db4d818da1be810a6dff59e08750d3 100644 (file)
@@ -1820,7 +1820,7 @@ static struct nexthop *nexthop_set_resolved(afi_t afi,
 
        /* Copy labels of the resolved route and the parent resolving to it */
        if (policy) {
-               int i = 0;
+               int label_num = 0;
 
                /*
                 * Don't push the first SID if the corresponding action in the
@@ -1828,10 +1828,11 @@ static struct nexthop *nexthop_set_resolved(afi_t afi,
                 */
                if (!newhop->nh_label || !newhop->nh_label->num_labels
                    || newhop->nh_label->label[0] == MPLS_LABEL_IMPLICIT_NULL)
-                       i = 1;
+                       label_num = 1;
 
-               for (; i < policy->segment_list.label_num; i++)
-                       labels[num_labels++] = policy->segment_list.labels[i];
+               for (; label_num < policy->segment_list.label_num; label_num++)
+                       labels[num_labels++] =
+                               policy->segment_list.labels[label_num];
                label_type = policy->segment_list.type;
        } else if (newhop->nh_label) {
                for (i = 0; i < newhop->nh_label->num_labels; i++) {