]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_packet.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / ospfd / ospf_packet.c
index b22fe5d99b7fe12be260742ae9d18525f8512482..5268c9896b470ca604214805fd882e5b7fa0d4dc 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Sending and Receiving OSPF Packets.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -43,6 +28,7 @@
 #include "ospfd/ospf_network.h"
 #include "ospfd/ospf_interface.h"
 #include "ospfd/ospf_ism.h"
+#include "ospfd/ospf_abr.h"
 #include "ospfd/ospf_asbr.h"
 #include "ospfd/ospf_lsa.h"
 #include "ospfd/ospf_lsdb.h"
@@ -3332,6 +3318,14 @@ static int ospf_make_hello(struct ospf_interface *oi, struct stream *s)
        else
                stream_putw(s, 0); /* hello-interval of 0 for fast-hellos */
 
+       /* Check if flood-reduction is enabled,
+        * if yes set the DC bit in the options.
+        */
+       if (OSPF_FR_CONFIG(oi->ospf, oi->area))
+               SET_FLAG(OPTIONS(oi), OSPF_OPTION_DC);
+       else if (CHECK_FLAG(OPTIONS(oi), OSPF_OPTION_DC))
+               UNSET_FLAG(OPTIONS(oi), OSPF_OPTION_DC);
+
        if (IS_DEBUG_OSPF_EVENT)
                zlog_debug("%s: options: %x, int: %s", __func__, OPTIONS(oi),
                           IF_NAME(oi));
@@ -3420,6 +3414,8 @@ static int ospf_make_db_desc(struct ospf_interface *oi,
        options = OPTIONS(oi);
        if (CHECK_FLAG(oi->ospf->config, OSPF_OPAQUE_CAPABLE))
                SET_FLAG(options, OSPF_OPTION_O);
+       if (OSPF_FR_CONFIG(oi->ospf, oi->area))
+               SET_FLAG(options, OSPF_OPTION_DC);
        stream_putc(s, options);
 
        /* DD flags */