summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtools/checkpatch.pl13
-rw-r--r--tools/cocci.h2
-rw-r--r--tools/etc/iproute2/rt_protos.d/frr.conf1
-rwxr-xr-xtools/frr-reload.py28
-rw-r--r--tools/gcc-plugins/frr-format.c6
-rwxr-xr-xtools/indent.py4
6 files changed, 33 insertions, 21 deletions
diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl
index ecae0e9..f52f1a1 100755
--- a/tools/checkpatch.pl
+++ b/tools/checkpatch.pl
@@ -4656,19 +4656,6 @@ sub process {
$herecurr);
}
-# check for sizeof(foo)/sizeof(foo[0]) that could be ARRAY_SIZE(foo)
- if ($line =~ m@\bsizeof\s*\(\s*($Lval)\s*\)@) {
- my $array = $1;
- if ($line =~ m@\b(sizeof\s*\(\s*\Q$array\E\s*\)\s*/\s*sizeof\s*\(\s*\Q$array\E\s*\[\s*0\s*\]\s*\))@) {
- my $array_div = $1;
- if (WARN("ARRAY_SIZE",
- "Prefer ARRAY_SIZE($array)\n" . $herecurr) &&
- $fix) {
- $fixed[$fixlinenr] =~ s/\Q$array_div\E/ARRAY_SIZE($array)/;
- }
- }
- }
-
# check for function declarations without arguments like "int foo()"
if ($line =~ /(\b$Type\s*$Ident)\s*\(\s*\)/) {
if (ERROR("FUNCTION_WITHOUT_ARGS",
diff --git a/tools/cocci.h b/tools/cocci.h
index 7d6bb4c..99076b5 100644
--- a/tools/cocci.h
+++ b/tools/cocci.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
/* some of this stuff doesn't seem to parse properly in coccinelle
*/
diff --git a/tools/etc/iproute2/rt_protos.d/frr.conf b/tools/etc/iproute2/rt_protos.d/frr.conf
index bbb358f..3e0fc2e 100644
--- a/tools/etc/iproute2/rt_protos.d/frr.conf
+++ b/tools/etc/iproute2/rt_protos.d/frr.conf
@@ -12,3 +12,4 @@
195 pbr
196 static
197 openfabric
+198 srte
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index b06f1df..461f0e8 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -1013,16 +1013,17 @@ def bgp_delete_move_lines(lines_to_add, lines_to_del):
del_dict[ctx_keys[0]][re_pg.group(1)] = list()
found_pg_del_cmd = True
+ # move neighbor remote-as lines at the end
+ for ctx_keys, line in lines_to_del_to_app:
+ lines_to_del.remove((ctx_keys, line))
+ lines_to_del.append((ctx_keys, line))
+
if found_pg_del_cmd == False:
bgp_delete_inst_move_line(lines_to_del)
if del_nbr_dict:
bgp_remove_neighbor_cfg(lines_to_del, del_nbr_dict)
return (lines_to_add, lines_to_del)
- for ctx_keys, line in lines_to_del_to_app:
- lines_to_del.remove((ctx_keys, line))
- lines_to_del.append((ctx_keys, line))
-
# {'router bgp 65001': {'PG': ['10.1.1.2'], 'PG1': ['10.1.1.21']},
# 'router bgp 65001 vrf vrf1': {'PG': ['10.1.1.2'], 'PG1': ['10.1.1.21']}}
for ctx_keys, line in lines_to_del:
@@ -1082,19 +1083,34 @@ def pim_delete_move_lines(lines_to_add, lines_to_del):
# Remove all such depdendent options from delete
# pending list.
pim_disable = False
+ lines_to_del_to_del = []
+ index = -1
for ctx_keys, line in lines_to_del:
+ index = index + 1
if ctx_keys[0].startswith("interface") and line and line == "ip pim":
pim_disable = True
+ # no ip msdp peer <> does not accept source so strip it off.
+ if line and line.startswith("ip msdp peer "):
+ pim_msdp_peer = re.search("ip msdp peer (\S+) source (\S+)", line)
+ if pim_msdp_peer:
+ source_sub_str = "source %s" % pim_msdp_peer.group(2)
+ new_line = line.replace(source_sub_str, "").strip()
+ lines_to_del.remove((ctx_keys, line))
+ lines_to_del.insert(index, (ctx_keys, new_line))
+
if pim_disable:
for ctx_keys, line in lines_to_del:
if (
ctx_keys[0].startswith("interface")
and line
- and line.startswith("ip pim ")
+ and (line.startswith("ip pim ") or line.startswith("ip multicast "))
):
- lines_to_del.remove((ctx_keys, line))
+ lines_to_del_to_del.append((ctx_keys, line))
+
+ for ctx_keys, line in lines_to_del_to_del:
+ lines_to_del.remove((ctx_keys, line))
return (lines_to_add, lines_to_del)
diff --git a/tools/gcc-plugins/frr-format.c b/tools/gcc-plugins/frr-format.c
index 4e2c2d3..963741e 100644
--- a/tools/gcc-plugins/frr-format.c
+++ b/tools/gcc-plugins/frr-format.c
@@ -66,6 +66,8 @@ static GTY(()) tree local_pid_t_node;
static GTY(()) tree local_uid_t_node;
static GTY(()) tree local_gid_t_node;
static GTY(()) tree local_time_t_node;
+static GTY(()) tree local_suseconds_t_node;
+static GTY(()) tree local_suseconds64_t_node;
static GTY(()) tree local_socklen_t_node;
static GTY(()) tree local_in_addr_t_node;
@@ -85,6 +87,8 @@ static struct type_special {
{ &local_uid_t_node, NULL, &local_uid_t_node, },
{ &local_gid_t_node, NULL, &local_gid_t_node, },
{ &local_time_t_node, NULL, &local_time_t_node, },
+ { &local_suseconds_t_node, NULL, &local_suseconds_t_node, },
+ { &local_suseconds64_t_node, NULL, &local_suseconds64_t_node, },
{ NULL, NULL, NULL, }
};
@@ -4176,6 +4180,8 @@ handle_finish_parse (void *event_data, void *data)
setup_type ("uid_t", &local_uid_t_node);
setup_type ("gid_t", &local_gid_t_node);
setup_type ("time_t", &local_time_t_node);
+ setup_type ("__suseconds_t", &local_suseconds_t_node);
+ setup_type ("__suseconds64_t", &local_suseconds64_t_node);
setup_type ("socklen_t", &local_socklen_t_node);
setup_type ("in_addr_t", &local_in_addr_t_node);
diff --git a/tools/indent.py b/tools/indent.py
index fe9eb7c..dac7d3f 100755
--- a/tools/indent.py
+++ b/tools/indent.py
@@ -34,13 +34,13 @@ def wrap_file(fn):
ci = subprocess.Popen(
["clang-format"], stdin=subprocess.PIPE, stdout=subprocess.PIPE
)
- stdout, ign = ci.communicate(text)
+ stdout, ign = ci.communicate(text.encode("utf-8"))
ci.wait()
if ci.returncode != 0:
raise IOError("clang-format returned %d" % (ci.returncode))
# remove the bits we inserted above
- final = clean_re.sub("", stdout)
+ final = clean_re.sub("", stdout.decode("utf-8"))
tmpname = fn + ".indent"
with open(tmpname, "w") as ofd: