summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkpatch.pl29
-rw-r--r--tools/coccinelle/hash_const.cocci76
-rw-r--r--tools/etc/frr/daemons10
-rw-r--r--tools/etc/rsyslog.d/45-frr.conf2
-rwxr-xr-xtools/frr-reload.py24
-rwxr-xr-xtools/frr.in2
-rw-r--r--tools/frrcommon.sh.in2
7 files changed, 142 insertions, 3 deletions
diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl
index 77e6e9a330..1b48d10a09 100755
--- a/tools/checkpatch.pl
+++ b/tools/checkpatch.pl
@@ -6347,6 +6347,35 @@ sub process {
"Please, only use 32 bit atomics.\n" . $herecurr);
}
+# check for use of strcpy()
+ if ($line =~ /\bstrcpy\s*\(.*\)/) {
+ ERROR("STRCPY",
+ "strcpy() is error-prone; please use strlcpy()" . $herecurr);
+ }
+
+# check for use of strncpy()
+ if ($line =~ /\bstrncpy\s*\(.*\)/) {
+ WARN("STRNCPY",
+ "strncpy() is error-prone; please use strlcpy() if possible, or memcpy()" . $herecurr);
+ }
+
+# check for use of strcat()
+ if ($line =~ /\bstrcat\s*\(.*\)/) {
+ ERROR("STRCAT",
+ "strcat() is error-prone; please use strlcat() if possible" . $herecurr);
+ }
+
+# check for use of strncat()
+ if ($line =~ /\bstrncat\s*\(.*\)/) {
+ WARN("STRNCAT",
+ "strncat() is error-prone; please use strlcat() if possible" . $herecurr);
+ }
+
+# check for use of bzero()
+ if ($line =~ /\bbzero\s*\(.*\)/) {
+ ERROR("BZERO",
+ "bzero() is deprecated; use memset()" . $herecurr);
+ }
}
# If we have no input at all, then there is nothing to report on
diff --git a/tools/coccinelle/hash_const.cocci b/tools/coccinelle/hash_const.cocci
new file mode 100644
index 0000000000..9c53cb01fb
--- /dev/null
+++ b/tools/coccinelle/hash_const.cocci
@@ -0,0 +1,76 @@
+//
+// Transition hash key signatures to take their argument as const.
+// Does not handle headers or weirdly named hash functions.
+//
+@noconst disable optional_qualifier@
+identifier A;
+identifier func =~ ".*key$|.*key_make$|.*hash_make$|.*hash_keymake$|.*hash_key$|.*hash_key.*";
+@@
+
+- func (void *A)
++ func (const void *A)
+ { ... }
+
+@ depends on noconst disable optional_qualifier @
+identifier noconst.A;
+identifier noconst.func;
+identifier b;
+type T;
+@@
+
+func( ... ) {
+<...
+- T b = A;
++ const T b = A;
+...>
+ }
+
+@ depends on noconst disable optional_qualifier @
+identifier noconst.A;
+identifier noconst.func;
+identifier b;
+type T;
+@@
+
+func(...)
+ {
+<...
+- T b = (T) A;
++ const T b = A;
+...>
+ }
+
+@ depends on noconst disable optional_qualifier @
+identifier noconst.A;
+identifier noconst.func;
+identifier b;
+type T;
+@@
+
+func(...)
+ {
+<...
+- T b;
++ const T b;
+...
+ b = A;
+...>
+ }
+
+@ depends on noconst disable optional_qualifier @
+identifier noconst.A;
+identifier noconst.func;
+identifier b;
+type T;
+@@
+
+func(...)
+ {
+<...
+- T b;
++ const T b;
+...
+- b = (T) A;
++ b = A;
+...>
+ }
diff --git a/tools/etc/frr/daemons b/tools/etc/frr/daemons
index 2abff422c9..79c52d30d1 100644
--- a/tools/etc/frr/daemons
+++ b/tools/etc/frr/daemons
@@ -29,6 +29,7 @@ sharpd=no
pbrd=no
bfdd=no
fabricd=no
+vrrpd=no
#
# If this option is set the /etc/init.d/frr script automatically loads
@@ -53,6 +54,15 @@ pbrd_options=" -A 127.0.0.1"
staticd_options="-A 127.0.0.1"
bfdd_options=" -A 127.0.0.1"
fabricd_options="-A 127.0.0.1"
+vrrpd_options=" -A 127.0.0.1"
+
+#
+# This is the maximum number of FD's that will be available.
+# Upon startup this is read by the control files and ulimit
+# is called. Uncomment and use a reasonable value for your
+# setup if you are expecting a large number of peers in
+# say BGP.
+#MAX_FDS=1024
# The list of daemons to watch is automatically generated by the init script.
#watchfrr_options=""
diff --git a/tools/etc/rsyslog.d/45-frr.conf b/tools/etc/rsyslog.d/45-frr.conf
index 4612e8beaf..feeeb13f13 100644
--- a/tools/etc/rsyslog.d/45-frr.conf
+++ b/tools/etc/rsyslog.d/45-frr.conf
@@ -16,6 +16,7 @@ if $programname == 'babeld' or
$programname == 'pimd' or
$programname == 'ripd' or
$programname == 'ripngd' or
+ $programname == 'vrrpd' or
$programname == 'watchfrr' or
$programname == 'zebra'
then :omfile:$frr_log
@@ -33,6 +34,7 @@ if $programname == 'babeld' or
$programname == 'pimd' or
$programname == 'ripd' or
$programname == 'ripngd' or
+ $programname == 'vrrpd' or
$programname == 'watchfrr' or
$programname == 'zebra'
then stop
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index 59f1bcf52b..23e8f3000d 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -410,7 +410,8 @@ end
"service ",
"table ",
"username ",
- "zebra ")
+ "zebra ",
+ "vrrp autoconfigure")
for line in self.lines:
@@ -742,6 +743,27 @@ def ignore_delete_re_add_lines(lines_to_add, lines_to_del):
lines_to_add_to_del.append((tmp_ctx_keys, swpx_peergroup))
'''
+ Changing the bfd timers on neighbors is allowed without doing
+ a delete/add process. Since doing a "no neighbor blah bfd ..."
+ will cause the peer to bounce unnecessarily, just skip the delete
+ and just do the add.
+ '''
+ re_nbr_bfd_timers = re.search(r'neighbor (\S+) bfd (\S+) (\S+) (\S+)', line)
+
+ if re_nbr_bfd_timers:
+ nbr = re_nbr_bfd_timers.group(1)
+ bfd_nbr = "neighbor %s" % nbr
+
+ for (ctx_keys, add_line) in lines_to_add:
+ re_add_nbr_bfd_timers = re.search(r'neighbor (\S+) bfd (\S+) (\S+) (\S+)', add_line)
+
+ if re_add_nbr_bfd_timers:
+ found_add_bfd_nbr = line_exist(lines_to_add, ctx_keys, bfd_nbr, False)
+
+ if found_add_bfd_nbr:
+ lines_to_del_to_del.append((ctx_keys, line))
+
+ '''
We changed how we display the neighbor interface command. Older
versions of frr would display the following:
neighbor swp1 interface
diff --git a/tools/frr.in b/tools/frr.in
index 2e3a094589..d871afa42b 100755
--- a/tools/frr.in
+++ b/tools/frr.in
@@ -25,7 +25,7 @@ FRR_VTY_GROUP="@enable_vty_group@" # frrvty
# Local Daemon selection may be done by using /etc/frr/daemons.
# See /usr/share/doc/frr/README.Debian.gz for further information.
# Keep zebra first and do not list watchfrr!
-DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld pimd ldpd nhrpd eigrpd sharpd pbrd staticd bfdd fabricd"
+DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld pimd ldpd nhrpd eigrpd sharpd pbrd staticd bfdd fabricd vrrpd"
MAX_INSTANCES=5
RELOAD_SCRIPT="$D_PATH/frr-reload.py"
diff --git a/tools/frrcommon.sh.in b/tools/frrcommon.sh.in
index 897e6d6558..3fc38d4bed 100644
--- a/tools/frrcommon.sh.in
+++ b/tools/frrcommon.sh.in
@@ -29,7 +29,7 @@ FRR_VTY_GROUP="@enable_vty_group@" # frrvty
# - keep zebra first
# - watchfrr does NOT belong in this list
-DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld pimd ldpd nhrpd eigrpd sharpd pbrd staticd bfdd fabricd"
+DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld pimd ldpd nhrpd eigrpd sharpd pbrd staticd bfdd fabricd vrrpd"
RELOAD_SCRIPT="$D_PATH/frr-reload.py"
#