]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #1563 from opensourcerouting/isis-bpf-hlen
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 19 Dec 2017 17:57:42 +0000 (12:57 -0500)
committerGitHub <noreply@github.com>
Tue, 19 Dec 2017 17:57:42 +0000 (12:57 -0500)
Unbreak ISIS Hellos (FreeBSD)

31 files changed:
bgpd/bgp_evpn_vty.c
bgpd/bgp_route.c
configure.ac
doc/Makefile.am
doc/install.texi
doc/pimd.texi [new file with mode: 0644]
doc/routemap.texi
isisd/dict.h
lib/md5.c
lib/md5.h
lib/zassert.h
ospfd/OSPF-ALIGNMENT.txt
pimd/pim_ifchannel.c
pkgsrc/README.txt
ripd/ripd.conf.sample
ripngd/ripngd.conf.sample
tests/helpers/c/main.c
tests/lib/test_heavy.c
tests/lib/test_heavy_thread.c
tests/lib/test_privs.c
zebra/connected.c
zebra/ipforward_sysctl.c
zebra/kernel_socket.c
zebra/rib.h
zebra/rt_netlink.c
zebra/rtread_getmsg.c
zebra/zebra.conf.sample
zebra/zebra_fpm.c
zebra/zebra_rib.c
zebra/zebra_static.c
zebra/zebra_vty.c

index f473b4604a778c572e1bb20086f775ea1223aa8f..4114c45221307575e6105875f89b2f5e4936294f 100644 (file)
@@ -414,9 +414,9 @@ static void show_vni_entry(struct hash_backet *backet, void *args[])
 {
        struct vty *vty;
        json_object *json;
-       json_object *json_vni;
-       json_object *json_import_rtl;
-       json_object *json_export_rtl;
+       json_object *json_vni = NULL;
+       json_object *json_import_rtl = NULL;
+       json_object *json_export_rtl = NULL;
        struct bgpevpn *vpn = (struct bgpevpn *)backet->data;
        char buf1[10];
        char buf2[RD_ADDRSTRLEN];
index 2323572488ec69688e8d4c24d927162b171774c3..88d2044f457f7aca306959aee5bc9175bf1a9cfb 100644 (file)
@@ -8394,8 +8394,9 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                                vty_out(vty, ",\"%s\": ", buf2);
 
                        vty_out(vty, "%s",
-                               json_object_to_json_string_ext(json_paths, JSON_C_TO_STRING_PRETTY));
+                               json_object_to_json_string(json_paths));
                        json_object_free(json_paths);
+                       json_paths = NULL;
                        first = 0;
                }
        }
@@ -8409,7 +8410,8 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                *total_cum = total_count;
        }
        if (use_json) {
-               json_object_free(json_paths);
+               if (json_paths)
+                       json_object_free(json_paths);
                if (is_last)
                        vty_out(vty, " } }\n");
                else
index 911de537ecbaf9b608a03e5eb8559f2a2586097a..a3b38559e55fa054d5fd14fc6aa20de3ffd32a7e 100755 (executable)
@@ -354,6 +354,8 @@ AC_ARG_ENABLE(logfile_mask,
   AS_HELP_STRING([--enable-logfile-mask=ARG], [set mask for log files]))
 AC_ARG_ENABLE(shell_access,
   AS_HELP_STRING([--enable-shell-access], [Allow users to access shell/telnet/ssh]))
+AC_ARG_ENABLE(realms,
+  AS_HELP_STRING([--enable-realms], [enable REALMS support under Linux]))
 AC_ARG_ENABLE(rtadv,
   AS_HELP_STRING([--disable-rtadv], [disable IPV6 router advertisement feature]))
 AC_ARG_ENABLE(irdp,
@@ -879,6 +881,7 @@ case "$host_os" in
 
     AC_DEFINE(OPEN_BSD,,OpenBSD)
     AC_DEFINE(KAME,1,KAME IPv6)
+    AC_DEFINE(BSD_V6_SYSCTL,1,BSD v6 sysctl to turn on and off forwarding)
 
     if test "x${enable_pimd}" != "xno"; then
       case "$host_os" in
@@ -895,12 +898,29 @@ case "$host_os" in
 
     AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
     AC_DEFINE(KAME,1,KAME IPv6)
+    AC_DEFINE(BSD_V6_SYSCTL,1,BSD v6 sysctl to turn on and off forwarding)
     ;;
 esac
 AM_CONDITIONAL(SOLARIS, test "${SOLARIS}" = "solaris")
 
 AC_SYS_LARGEFILE
 
+dnl ------------------------
+dnl Integrated REALMS option
+dnl ------------------------
+if test "${enable_realms}" = "yes"; then
+    case "$host_os" in
+      linux*)
+       AC_DEFINE(SUPPORT_REALMS,, Realms support)
+       ;;
+      *)
+       echo "Sorry, only Linux has REALMS support"
+       exit 1
+       ;;
+    esac
+fi
+AM_CONDITIONAL([SUPPORT_REALMS], [test "${enable_realms}" = "yes"])
+
 dnl ---------------------
 dnl Integrated VTY option
 dnl ---------------------
index 6c80ddeaa4a67febea3acfa0883283867a22e0f6..7aaa36556f25da4647ba0f0ed1a8552f469d5a74 100644 (file)
@@ -59,17 +59,37 @@ $(srcdir)/frr.info: $(frr_TEXINFOS) defines.texi
 frr.dvi: $(frr_TEXINFOS) defines.texi
 frr.html: $(frr_TEXINFOS) defines.texi
 
-frr_TEXINFOS = appendix.texi basic.texi bgpd.texi isisd.texi filter.texi \
+frr_TEXINFOS = \
+       appendix.texi \
+       basic.texi \
+       bgpd.texi \
+       isisd.texi \
+       filter.texi \
        vnc.texi \
        babeld.texi \
-       install.texi ipv6.texi kernel.texi main.texi \
+       install.texi \
+       ipv6.texi  \
+       kernel.texi \
+       main.texi \
        nhrpd.texi \
        eigrpd.texi \
-       ospf6d.texi ospfd.texi \
-       overview.texi protocol.texi ripd.texi ripngd.texi routemap.texi \
-       snmp.texi vtysh.texi routeserver.texi $(figures_png) \
-       snmptrap.texi ospf_fundamentals.texi isisd.texi $(figures_txt) \
-       rpki.texi
+       ospf6d.texi \
+       ospfd.texi \
+       overview.texi \
+       protocol.texi \
+       ripd.texi \
+       ripngd.texi \
+       routemap.texi \
+       snmp.texi \
+       vtysh.texi \
+       routeserver.texi \
+       $(figures_png) \
+       snmptrap.texi \
+       ospf_fundamentals.texi \
+       isisd.texi $(figures_txt) \
+       rpki.texi \
+       pimd.texi \
+       #END
 
 .png.eps:
        $(PNGTOEPS) $< "$@"
index 19d9614420f8788377855898eeaf5445fe5028b7..d0d56804b059ffb54dc92c9c553ff83a29c907fe 100644 (file)
@@ -85,6 +85,10 @@ Enable Traffic Engineering Extension for ISIS (RFC5305)
 @item --enable-multipath=@var{ARG}
 Enable support for Equal Cost Multipath. @var{ARG} is the maximum number
 of ECMP paths to allow, set to 0 to allow unlimited number of paths.
+@item --enable-realms
+Enable the support of linux Realms.  Convert tag values from 1-255
+into a realm value when inserting into the linux kernel.  Then
+routing policy can be assigned to the realm.  See the tc man page.
 @item --disable-rtadv
 Disable support IPV6 router advertisement in zebra.
 @item --enable-gcc-rdynamic
diff --git a/doc/pimd.texi b/doc/pimd.texi
new file mode 100644 (file)
index 0000000..30e85af
--- /dev/null
@@ -0,0 +1,366 @@
+@c -*-texinfo-*-
+@c This is part of the Frr Manual.
+@c @value{COPYRIGHT_STR}
+@c See file frr.texi for copying conditions.
+@node PIM
+@chapter PIM
+
+PIM -- Protocol Independent Multicast
+
+@command{pimd} supports pim-sm as well as igmp v2 and v3.  pim is
+vrf aware and can work within the context of vrf's in order to
+do S,G mrouting.
+
+@menu
+* Starting and Stopping pimd::
+* PIM Configuration::
+* PIM Interface Configuration::
+* PIM Multicast RIB insertion::
+* Show PIM Information::
+* PIM Debug Commands::
+@end menu
+
+@node Starting and Stopping pimd
+@section Starting and Stopping pimd
+
+The default configuration file name of @command{pimd}'s is
+@file{pimd.conf}.  When invocation @command{pimd} searches directory
+@value{INSTALL_PREFIX_ETC}.  If @file{pimd.conf} is not there
+then next search current directory.
+
+@command{pimd} requires zebra for proper operation.  Additionally
+@command{pimd} depends on routing properly setup and working
+in the network that it is working on.
+
+@example
+@group
+# zebra -d
+# pimd -d
+@end group
+@end example
+
+Please note that @command{zebra} must be invoked before @command{pimd}.
+
+To stop @command{pimd}.  Please use @command{kill `cat
+/var/run/pimd.pid`}.  Certain signals have special meanings to @command{pimd}.
+
+@table @samp
+@item SIGUSR1
+Rotate @command{pimd} logfile.
+@item SIGINT
+@itemx SIGTERM
+@command{pimd} sweeps all installed PIM mroutes then terminates properly.
+@end table
+
+@command{pimd} invocation options.  Common options that can be specified
+(@pxref{Common Invocation Options}).
+
+@node PIM Configuration
+
+@deffn Command {ip pim rp A.B.C.D A.B.C.D/M} {}
+In order to use pim, it is necessary to configure a RP for join
+messages to be sent to.  Currently the only methodology to
+do this is via static rp commands.  All routers in the
+pim network must agree on these values.  The first ip address
+is the RP's address and the second value is the matching
+prefix of group ranges covered.  This command is vrf aware,
+to configure for a vrf, enter the vrf submode.
+@end deffn
+
+@deffn Command {ip pim spt-switchover infinity-and-beyond} {}
+On the last hop router if it is desired to not switch over
+to the SPT tree. Configure this command.  This command is
+vrf aware, to configure for a vrf, enter the vrf submode.
+#end deffn
+
+@deffn Comand {ip pim ecmp} {}
+If pim has the a choice of ECMP nexthops for a particular
+RPF, pim will cause S,G flows to be spread out amongst
+the nexthops.  If this command is not specified then
+the first nexthop found will be used.  This command
+is vrf aware, to configure for a vrf, enter the vrf submode.
+@end deffn
+
+@deffn Command {ip pim ecmp rebalance} {}
+If pim is using ECMP and an interface goes down, cause
+pim to rebalance all S,G flows aross the remaining
+nexthops.  If this command is not configured pim only
+modifies those S,G flows that were using the interface
+that went down.  This command is vrf aware, to configure
+for a vrf, enter the vrf submode.
+@end deffn
+
+@deffn Command {ip pim join-prune-interval (60-600)} {}
+Modify the join/prune interval that pim uses to the
+new value.  Time is specified in seconds.  This command
+is vrf aware, to configure for a vrf, enter the vrf submode.
+@end deffn
+
+@deffn Command {ip pim keep-alive-timer (31-60000)} {}
+Modify the time out value for a S,G flow from 31-60000
+seconds.  31 seconds is choosen for a lower bound
+because some hardware platforms cannot see data flowing
+in better than 30 second chunks.  This comand is vrf
+aware, to configure for a vrf, enter the vrf submode.
+@end deffn
+
+@deffn Command {ip pim packets (1-100)} {}
+When processing packets from a neighbor process the
+number of packets incoming at one time before moving
+on to the next task.  The default value is 3 packets.
+This command is only useful at scale when you can
+possibly have a large number of pim control packets
+flowing.  This command is vrf aware, to configure for
+a vrf, enter the vrf submode.
+@end deffn
+
+@deffn Command {ip pim register-suppress-time (5-60000)} {}
+Modify the time that pim will register suppress a FHR
+will send register notifications to the kernel.  This command
+is vrf aware, to configure for a vrf, enter the vrf submode.
+@end deffn
+
+@deffn Command {ip pim send-v6-secondary} {}
+When sending pim hello packets tell pim to send
+any v6 secondary addresses on the interface.  This
+information is used to allow pim to use v6 nexthops
+in it's decision for RPF lookup.  This command
+is vrf aware, to configure for a vrf, enter the vrf submode.
+@end deffn
+
+@deffn Command {ip pim ssm prefix-list WORD} {}
+Specify a range of group addresses via a prefix-list
+that forces pim to never do SM over.  This command
+is vrf aware, to configure for a vrf, enter the vrf submode.
+@end deffn
+
+@deffn Command {ip multicast rpf-lookup-mode WORD} {}
+Modify how PIM does RPF lookups in the zebra routing table.
+You can use these choices:
+@table @lookup_modes
+@item longer-prefix
+Lookup the RPF in both tables using the longer prefix as a match
+@item lower-distance
+Lookup the RPF in both tables using the lower distance as a match
+@item mrib-only
+Lookup in the Multicast RIB only
+@item mrib-then-urib
+Lookup in the Multicast RIB then the Unicast Rib, returning first found.
+This is the default value for lookup if this command is not entered
+@item urib-only
+Lookup in the Unicast Rib only.
+@end table
+@end deffn
+
+@node PIM Interface Configuration
+@section PIM Interface Configuration
+
+PIM interface commands allow you to configure an
+interface as either a Receiver or a interface
+that you would like to form pim neighbors on.  If the
+interface is in a vrf, enter the interface command with
+the vrf keyword at the end.
+
+@deffn {PIM Interface Command] {ip pim bfd} {}
+Turns on BFD support for PIM for this interface.
+@end deffn
+
+@deffn {PIM Interface Command} {ip pim drpriority (1-4294967295)} {}
+Set the DR Priority for the interface.  This command is useful
+to allow the user to influence what node becomes the DR for a
+lan segment.
+@end deffn
+
+@deffn {PIM Interface Command} {ip pim hello (1-180) (1-180)} {}
+Set the pim hello and hold interval for a interface.
+@end deffn
+
+@deffn {PIM Interface Command} {ip pim sm} {}
+Tell pim that we would like to use this interface to form
+pim neighbors over.  Please note we will *not* accept
+igmp reports over this interface with this command.
+@end deffn
+
+@deffn {PIM Interface Command} {ip igmp} {}
+Tell pim to receive IGMP reports and Query on this
+interface.  The default version is v3.  This command
+is useful on the LHR.
+@end deffn
+
+@deffn {PIM Interface Command} {ip igmp query-interval (1-1800)} {}
+Set the IGMP query interval that PIM will use.
+@end deffn
+
+@deffn {PIM Interface Command} {ip igmp query-max-response-time (10-250)} {}
+Set the IGMP query response timeout value.  If an report is not returned
+in the specified time we will assume the S,G or *,G has timed out.
+@end deffn
+
+@deffn {PIM Interface Command} {ip igmp version (2-3)} {}
+Set the IGMP version used on this interface.  The default value
+is 3.
+@end deffn
+
+@deffn {PIM Interface Command} {ip multicat boundary oil WORD} {}
+Set a pim multicast boundary, based upon the WORD prefix-list.  If
+a pim join or IGMP report is received on this interface and the Group
+is denyed by the prefix-list, PIM will ignore the join or report.
+@end deffn
+
+@node PIM Multicast RIB insertion::
+@section PIM Multicast RIB insertion::
+
+In order to influence Multicast RPF lookup, it is possible to insert
+into zebra routes for the Multicast RIB.  These routes are only
+used for RPF lookup and will not be used by zebra for insertion
+into the kernel *or* for normal rib processing.  As such it is
+possible to create weird states with these commands.  Use with
+caution.  Most of the time this will not be necessary.
+
+@deffn {PIM Multicast RIB insertion} {ip mroute A.B.C.D/M A.B.C.D (1-255)} {}
+Insert into the Multicast Rib Route A.B.C.D/M with specified nexthop.  The distance can be specified as well if desired.
+@end deffn
+
+@deffn {PIM Multicast RIB insertion} {ip mroute A.B.C.D/M INTERFACE (1-255)} {}
+Insert into the Multicast Rib Route A.B.C.D/M using the specified INTERFACE.
+The distance can be specified as well if desired.
+@end deffn
+
+@node Show PIM Information::
+@section Show PIM Information
+
+All PIM show commands are vrf aware and typically allow you to insert
+a specified vrf command if information is desired about a specific vrf.
+If no vrf is specified then the default vrf is assumed.  Finally
+the special keyword 'all' allows you to look at all vrfs for the command.
+Naming a vrf 'all' will cause great confusion.
+
+@deffn {Show PIM Information} {show ip multicast}
+Display various information about the interfaces used in this pim
+instance.
+@end deffn
+
+@deffn {Show PIM Information} {show ip mroute}
+Display information about installed into the kernel S,G mroutes.
+@end deffn
+
+@deffn {Show PIM Information} {show ip mroute count}
+Display information about installed into the kernel S,G mroutes
+and in addition display data about packet flow for the mroutes.
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim assert}
+Display information about asserts in the PIM system for S,G mroutes.
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim assert-internal}
+Display internal assert state for S,G mroutes
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim assert-metric}
+Display metric information about assert state for S,G mroutes
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim assert-winner-metric}
+Display winner metric for assert state for S,G mroutes
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim group-type}
+Display SSM group ranges
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim interface}
+Display information about interfaces PIM is using.
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim join}
+Display information about PIM joins received.
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim local-membership} {}
+Display information about PIM interface local-membership
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim neighbor} {}
+Display information about PIM neighbors
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim nexthop} {}
+Display information about pim nexthops that are being
+used
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim nexthop-lookup} {}
+Display information about a S,G pair and how the RPF would
+be choosen.  This is especially useful if there are ECMP's
+available from the RPF lookup.
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim rp-info} {}
+Display information about RP's that are configured on
+this router
+@end deffn
+
+@deffn {Show PIM Information} {show ip pim rpf} {}
+Display information about currently being used S,G's
+and their RPF lookup information.  Additionally display
+some statistics about what has been happening on the
+router
+@end deffn
+
+@deffn {show PIM Information} {show ip pim secondary} {}
+Display information about an interface and all the
+secondary addresses associated with it
+@end deffn
+
+@deffn {show PIM Information} {show ip pim state} {}
+Display information about known S,G's and incoming
+interface as well as the OIL and how they were choosen
+@end deffn
+
+@deffn {show PIM Information} {show ip pim upstream} {}
+Display upstream information about a S,G mroute
+@end deffn
+
+@deffn {show PIM Information} {show ip pim upstream-join-desired} {}
+Display upstream information for S,G's and if we desire to
+join the mcast tree
+@end deffn
+
+@deffn {show PIM Information} {show ip pim upstream-rpf} {}
+Display upstream information for S,G's and the RPF data
+associated with them
+@end deffn
+
+@deffn {show PIM Information} {show ip rpf} {}
+Display the multicast RIB created in zebra
+@end deffn
+
+@node  PIM Debug Commands
+@section PIM Debug Commands
+
+The debugging subsystem for PIM behaves in accordance with how FRR handles debugging.  You can specify debugging at the enable cli mode as well as the configure cli mode.  If you specify debug commands in the configuration cli mode, the debug commands can be persistent across restarts of the FRR pimd if the config was written out.
+
+@deffn {PIM Debug Commands} {debug pim events}
+This turns on debugging for PIM system events.  Especially timers.
+@end deffn
+
+@deffn {PIM Debug Commands} {debug pim nht}
+This turns on debugging for PIM nexthop tracking.  It will display information about RPF lookups and information about when a nexthop changes.
+@end deffn
+
+@deffn {PIM Debug Commands} {debug pim packet-dump}
+This turns on an extraordinary amount of data.  Each pim packet sent and received is dumped for debugging purposes.  This should be considered a developer only command
+@end deffn
+
+@deffn {PIM Debug Commands} {debug pim packets}
+This turns on information about packet generation for sending and about packet handling from a received packet
+@end deffn
+
+@deffn {PIM Debug Commands} {debug pim trace}
+This traces pim code and how it is running.
+@end deffn
+
+@deffn {PIM Debug Commands} {debug pim zebra}
+This gathers data about events from zebra that come up through the zapi
+@end deffn
index b72f539c466604ebe7452e9884e2f5c5a577cd18..3e683f44d19841f3e438acd67379fb1dd4f757ae 100644 (file)
@@ -171,6 +171,11 @@ Matches the specified @var{as_path}.
 Matches the specified @var{metric}.
 @end deffn
 
+@deffn {Route-map Command} {match tag @var{tag}} {}
+Matches the specified tag value associated with the route.
+This tag value can be in the range of (1-4294967295).
+@end deffn
+
 @deffn {Route-map Command} {match local-preference @var{metric}} {}
 Matches the specified @var{local-preference}.
 @end deffn
@@ -198,6 +203,14 @@ in this manner.
 @node Route Map Set Command
 @section Route Map Set Command
 
+@deffn {Route-map Command} {set tag @var{tag}} {}
+Set a tag on the matched route.  This tag value can be from
+(1-4294967295).  Additionally if you have compiled with
+the --enable-realms configure option.  Tag values from (1-255)
+are sent to the linux kernel as a realm value.  Then route
+policy can be applied.  See the tc man page.
+@end deffn
+
 @deffn {Route-map Command} {set ip next-hop @var{ipv4_address}} {}
 Set the BGP nexthop address.
 @end deffn
index a5ee922318d8cd29e38ca6c3e2b02e4d59d02daa..32683c57d58a054fcd057f62ca1d5c46eca66dde 100644 (file)
@@ -14,8 +14,6 @@
  * into proprietary software; there is no requirement for such software to
  * contain a copyright notice related to this source.
  *
- * $Id: dict.h,v 1.3 2005/09/25 12:04:25 hasso Exp $
- * $Name:  $
  */
 
 #ifndef DICT_H
index cce67d7ec1d299e5d0a7cc9b9d904d90e36bb308..8989a93c597b2fb133c4e009b4f00fca5609a4b0 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -1,7 +1,3 @@
-/* $USAGI: md5.c,v 1.2 2000/11/02 11:59:24 yoshfuji Exp $ */
-/*     $KAME: md5.c,v 1.2 2000/05/27 07:07:48 jinmei Exp $     */
-/*     $Id: md5.c,v 1.6 2006/01/17 23:39:04 vincent Exp $ */
-
 /*
  * Copyright (C) 2004 6WIND
  *                          <Vincent.Jardin@6WIND.com>
index adc92d670da8abb0f65458ecb5844b5b90d935f9..59291c7df3bdd233f8fc510c9a50ea36bbbfb73e 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -1,7 +1,3 @@
-/* $USAGI: md5.h,v 1.2 2000/11/02 11:59:25 yoshfuji Exp $ */
-/*     $KAME: md5.h,v 1.4 2000/03/27 04:36:22 sumikawa Exp $   */
-/*     $Id: md5.h,v 1.3 2006/01/17 17:40:45 paul Exp $ */
-
 /*
  * Copyright (C) 2004 6WIND
  *                          <Vincent.Jardin@6WIND.com>
index 5c06d933e6fb277d38d9d537f793c5354e728d94..d45e1be5f8392c26e8fdff60609fffd38daca7d8 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: zassert.h,v 1.2 2004/12/03 18:01:04 ajs Exp $
- *
  * This file is part of Quagga.
  *
  * Quagga is free software; you can redistribute it and/or modify it
index dac6182fdeabca809ee7e50488b7d035ea851c08..905bd228b169692575331bc2f79228483ad996fd 100644 (file)
@@ -1,5 +1,3 @@
-$Id: OSPF-ALIGNMENT.txt,v 1.1 2004/11/17 17:59:52 gdt Exp $
-
 Greg Troxel <gdt@ir.bbn.com>
 2004-11-17
 
index 5f597b17b1b0f009138644a3fb8ae2f31da7d93a..7d3b783adf63569ce3e6119edfa7dbfece5a7c38 100644 (file)
@@ -640,6 +640,13 @@ static int on_ifjoin_prune_pending_timer(struct thread *t)
 
        ch = THREAD_ARG(t);
 
+       if (PIM_DEBUG_TRACE)
+               zlog_debug("%s: IFCHANNEL%s %s Prune Pending Timer Popped",
+                          __PRETTY_FUNCTION__,
+                          pim_str_sg_dump(&ch->sg),
+                          pim_ifchannel_ifjoin_name(ch->ifjoin_state,
+                                                    ch->flags));
+
        if (ch->ifjoin_state == PIM_IFJOIN_PRUNE_PENDING) {
                ifp = ch->interface;
                pim_ifp = ifp->info;
@@ -665,16 +672,19 @@ static int on_ifjoin_prune_pending_timer(struct thread *t)
                         *  message on RP path upon prune timer expiry.
                         */
                        ch->ifjoin_state = PIM_IFJOIN_PRUNE;
-                       if (ch->upstream)
+                       if (ch->upstream) {
+                               struct pim_upstream *parent =
+                                       ch->upstream->parent;
+
                                pim_upstream_update_join_desired(pim_ifp->pim,
                                                                 ch->upstream);
+
+                               pim_jp_agg_single_upstream_send(&parent->rpf,
+                                                               parent,
+                                                               true);
+                       }
                }
                /* from here ch may have been deleted */
-       } else {
-               zlog_warn(
-                       "%s: IFCHANNEL%s Prune Pending Timer Popped while in %s state",
-                       __PRETTY_FUNCTION__, pim_str_sg_dump(&ch->sg),
-                       pim_ifchannel_ifjoin_name(ch->ifjoin_state, ch->flags));
        }
 
        return 0;
index 13ec449a1f54eca54da507244a31fadd6519a751..b70bb3fc1d6a5b55aa21fdc48947cd92a1736951 100644 (file)
@@ -1,5 +1,3 @@
-$Id: README.txt,v 1.1 2004/08/27 15:57:35 gdt Exp $
-
 This directory contains files for use with the pkgsrc framework
 (http://www.pkgsrc.org) used with NetBSD and other operating systems.
 Eventually it will be hooked into automake such that they can be
index 2902ff9cca1556103e0352d1903fab50f23bac35..e11bf0bb2362bbf5d5d8b75d61a22aaa6cbb07d7 100644 (file)
@@ -2,8 +2,6 @@
 !
 ! RIPd sample configuration file
 !
-! $Id: ripd.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
-!
 hostname ripd
 password zebra
 !
index ad673e57e0ba7d64c2d94e81b452510ceb82771a..28f08c399a674959c189e02889f8eeddf0b65bc4 100644 (file)
@@ -2,8 +2,6 @@
 !
 ! RIPngd sample configuration file
 !
-! $Id: ripngd.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
-!
 hostname ripngd
 password zebra
 !
index 9bf56dde14d5dcccf6c9c72225a92c97751aa55b..fed1d5a53735f306cce0dcf0569459e4014184a7 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: main.c,v 1.1 2005/04/25 16:42:24 paul Exp $
- *
  * This file is part of Quagga.
  *
  * Quagga is free software; you can redistribute it and/or modify it
index 604a5733cab493bb5181e4070db94a836d2005b8..e2a0a2d49a1e1c9c0c4c1d554d738db09a7ab682 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: heavy.c,v 1.3 2005/04/25 16:42:24 paul Exp $
- *
  * This file is part of Quagga.
  *
  * Quagga is free software; you can redistribute it and/or modify it
index 9a75780060cdf391f83221eba1dafb3e7ac434f0..075bcb6daf7b5c6c2abca54f4a2738a3684a4dad 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: heavy-thread.c,v 1.2 2005/04/25 16:42:24 paul Exp $
- *
  * This file is part of Quagga.
  *
  * Quagga is free software; you can redistribute it and/or modify it
index 1984f28e635d2a7dab84f15932cfaf2b38c44c3d..421c3454365761f7ec24a66662f3c7862f236148 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: test-privs.c,v 1.1 2005/10/11 03:48:28 paul Exp $
- *
  * This file is part of Quagga.
  *
  * Quagga is free software; you can redistribute it and/or modify it
index 18dc6a970b5427d7374cc6a79665fdc500cce680..9c0a3af8e39782e39d2aad7e232c402d54e7e88c 100644 (file)
@@ -239,10 +239,10 @@ void connected_up(struct interface *ifp, struct connected *ifc)
        }
 
        rib_add(afi, SAFI_UNICAST, ifp->vrf_id, ZEBRA_ROUTE_CONNECT, 0, 0,
-               &p, NULL, &nh, RT_TABLE_MAIN, ifp->metric, 0, 0);
+               &p, NULL, &nh, RT_TABLE_MAIN, ifp->metric, 0, 0, 0);
 
        rib_add(afi, SAFI_MULTICAST, ifp->vrf_id, ZEBRA_ROUTE_CONNECT, 0, 0,
-               &p, NULL, &nh, RT_TABLE_MAIN, ifp->metric, 0, 0);
+               &p, NULL, &nh, RT_TABLE_MAIN, ifp->metric, 0, 0, 0);
 
        if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
                char buf[PREFIX_STRLEN];
index 36212a0132826c7082ba727a46b356ec10d29d7b..cdf426b9b8ff268f21e59e04fd5f5da361c6e56d 100644 (file)
@@ -87,11 +87,11 @@ int ipforward_off(void)
 
 /* IPv6 forwarding control MIB. */
 int mib_ipv6[MIB_SIZ] = {CTL_NET, PF_INET6,
-#if defined(KAME)
+#if defined(BSD_V6_SYSCTL)
                         IPPROTO_IPV6, IPV6CTL_FORWARDING
-#else  /* NOT KAME */
+#else  /* NOT BSD_V6_SYSCTL */
                         IPPROTO_IP, IP6CTL_FORWARDING
-#endif /* KAME */
+#endif /* BSD_V6_SYSCTL */
 };
 
 int ipforward_ipv6(void)
index 89c933f90ff53f8d40e953bccfda264b81eb2d63..d45a502543d1aee80760f20036e53aceca2ad04c 100644 (file)
@@ -1050,7 +1050,7 @@ void rtm_read(struct rt_msghdr *rtm)
                    || rtm->rtm_type == RTM_CHANGE)
                        rib_add(AFI_IP, SAFI_UNICAST, VRF_DEFAULT,
                                ZEBRA_ROUTE_KERNEL, 0, zebra_flags, &p, NULL,
-                               &nh, 0, 0, 0, 0);
+                               &nh, 0, 0, 0, 0, 0);
                else
                        rib_delete(AFI_IP, SAFI_UNICAST, VRF_DEFAULT,
                                   ZEBRA_ROUTE_KERNEL, 0, zebra_flags, &p, NULL,
@@ -1098,7 +1098,7 @@ void rtm_read(struct rt_msghdr *rtm)
                    || rtm->rtm_type == RTM_CHANGE)
                        rib_add(AFI_IP6, SAFI_UNICAST, VRF_DEFAULT,
                                ZEBRA_ROUTE_KERNEL, 0, zebra_flags, &p, NULL,
-                               &nh, 0, 0, 0, 0);
+                               &nh, 0, 0, 0, 0, 0);
                else
                        rib_delete(AFI_IP6, SAFI_UNICAST, VRF_DEFAULT,
                                   ZEBRA_ROUTE_KERNEL, 0, zebra_flags, &p, NULL,
index 4b82e8d8d5b9aaabe45109ae41d04c3f2d63aff3..804372f18e1157037188a3faf25abc90ea528edb 100644 (file)
@@ -85,8 +85,7 @@ struct route_entry {
 /* to simplify NHT logic when NHs change, instead of doing a NH by NH cmp */
 #define ROUTE_ENTRY_NEXTHOPS_CHANGED 0x2
 #define ROUTE_ENTRY_CHANGED          0x4
-#define ROUTE_ENTRY_SELECTED_FIB     0x8
-#define ROUTE_ENTRY_LABELS_CHANGED   0x10
+#define ROUTE_ENTRY_LABELS_CHANGED   0x8
 
        /* Nexthop information. */
        u_char nexthop_num;
@@ -122,6 +121,8 @@ typedef struct rib_dest_t_ {
         */
        struct route_entry *routes;
 
+       struct route_entry *selected_fib;
+
        /*
         * Flags, see below.
         */
@@ -296,7 +297,7 @@ extern int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
                   u_short instance, int flags, struct prefix *p,
                   struct prefix_ipv6 *src_p, const struct nexthop *nh,
                   u_int32_t table_id, u_int32_t metric, u_int32_t mtu,
-                  uint8_t distance);
+                  uint8_t distance, route_tag_t tag);
 
 extern int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *,
                             struct prefix_ipv6 *src_p, struct route_entry *);
index cbe736e00cc1c06bd3ce98b9c01c5603d8bd18b8..910f9b3d93fa778fdd00b7cb213253ad9fd41068 100644 (file)
@@ -230,6 +230,7 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
        int metric = 0;
        u_int32_t mtu = 0;
        uint8_t distance = 0;
+       route_tag_t tag = 0;
 
        void *dest = NULL;
        void *gate = NULL;
@@ -321,6 +322,11 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
        if (tb[RTA_PRIORITY])
                metric = *(int *)RTA_DATA(tb[RTA_PRIORITY]);
 
+#if defined(SUPPORT_REALMS)
+       if (tb[RTA_FLOW])
+               tag = *(uint32_t *)RTA_DATA(tb[RTA_FLOW]);
+#endif
+
        if (tb[RTA_METRICS]) {
                struct rtattr *mxrta[RTAX_MAX + 1];
 
@@ -429,7 +435,8 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
                                memcpy(&nh.gate, gate, sz);
 
                        rib_add(afi, SAFI_UNICAST, vrf_id, proto,
-                               0, flags, &p, NULL, &nh, table, metric, mtu, distance);
+                               0, flags, &p, NULL, &nh, table, metric,
+                               mtu, distance, tag);
                } else {
                        /* This is a multipath route */
 
@@ -449,6 +456,7 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
                        re->table = table;
                        re->nexthop_num = 0;
                        re->uptime = time(NULL);
+                       re->tag = tag;
 
                        for (;;) {
                                if (len < (int)sizeof(*rtnh)
@@ -1310,7 +1318,10 @@ static int netlink_route_multipath(int cmd, struct prefix *p,
         * by the routing protocol and for communicating with protocol peers.
         */
        addattr32(&req.n, sizeof req, RTA_PRIORITY, NL_DEFAULT_ROUTE_METRIC);
-
+#if defined(SUPPORT_REALMS)
+       if (re->tag > 0 && re->tag <= 255)
+               addattr32(&req.n, sizeof req, RTA_FLOW, re->tag);
+#endif
        /* Table corresponding to this route. */
        if (re->table < 256)
                req.r.rtm_table = re->table;
index 39ecdb335c60da5c287659ea2a85d8ef33321781..69e45f9a6c4cc2c08e118df4af28fa841dcf0095 100644 (file)
@@ -98,7 +98,7 @@ static void handle_route_entry(mib2_ipRouteEntry_t *routeEntry)
        nh.gate.ipv4.s_addr = routeEntry->ipRouteNextHop;
 
        rib_add(AFI_IP, SAFI_UNICAST, VRF_DEFAULT, ZEBRA_ROUTE_KERNEL, 0,
-               zebra_flags, &prefix, NULL, &nh, 0, 0, 0, 0);
+               zebra_flags, &prefix, NULL, &nh, 0, 0, 0, 0, 0);
 }
 
 void route_read(struct zebra_ns *zns)
index a5d0732f6b3d2fc09ac77a827c7fab0922791a99..03042eb083ba683c60a7323244b4c01c4b3af0f1 100644 (file)
@@ -2,8 +2,6 @@
 !
 ! zebra sample configuration file
 !
-! $Id: zebra.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
-!
 hostname Router
 password zebra
 enable password zebra
index 7448292d9f1c707a142a5ed260f357a0284a7bf0..0d0a2cb3bf1ed450792459e0d4512c71588aa096 100644 (file)
@@ -842,19 +842,7 @@ static inline int zfpm_encode_route(rib_dest_t *dest, struct route_entry *re,
  */
 struct route_entry *zfpm_route_for_update(rib_dest_t *dest)
 {
-       struct route_entry *re;
-
-       RE_DEST_FOREACH_ROUTE (dest, re) {
-               if (!CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB))
-                       continue;
-
-               return re;
-       }
-
-       /*
-        * We have no route for this destination.
-        */
-       return NULL;
+       return dest->selected_fib;
 }
 
 /*
index 58b69659955cf2328e05592c225963376685af0d..3eaf5597b2d4f1f1db3a874628d5be72700d1882 100644 (file)
@@ -383,10 +383,11 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
        struct prefix p;
        struct route_table *table;
        struct route_node *rn;
-       struct route_entry *match;
+       struct route_entry *match = NULL;
        int resolved;
        struct nexthop *newhop;
        struct interface *ifp;
+       rib_dest_t *dest;
 
        if ((nexthop->type == NEXTHOP_TYPE_IPV4)
            || nexthop->type == NEXTHOP_TYPE_IPV6)
@@ -466,17 +467,12 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
                    && !nh_resolve_via_default(p.family))
                        return 0;
 
-               RNODE_FOREACH_RE (rn, match) {
-                       if (CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED))
-                               continue;
-
-                       /* if the next hop is imported from another table, skip
-                        * it */
-                       if (match->type == ZEBRA_ROUTE_TABLE)
-                               continue;
-                       if (CHECK_FLAG(match->status, ROUTE_ENTRY_SELECTED_FIB))
-                               break;
-               }
+               dest = rib_dest_from_rnode(rn);
+               if (dest && dest->selected_fib &&
+                   !CHECK_FLAG(dest->selected_fib->status,
+                               ROUTE_ENTRY_REMOVED) &&
+                   dest->selected_fib->type != ZEBRA_ROUTE_TABLE)
+                       match = dest->selected_fib;
 
                /* If there is no selected route or matched route is EGP, go up
                   tree. */
@@ -553,7 +549,7 @@ struct route_entry *rib_match(afi_t afi, safi_t safi, vrf_id_t vrf_id,
        struct prefix p;
        struct route_table *table;
        struct route_node *rn;
-       struct route_entry *match;
+       struct route_entry *match = NULL;
        struct nexthop *newhop;
 
        /* Lookup table.  */
@@ -574,15 +570,14 @@ struct route_entry *rib_match(afi_t afi, safi_t safi, vrf_id_t vrf_id,
        rn = route_node_match(table, (struct prefix *)&p);
 
        while (rn) {
+               rib_dest_t *dest;
+
                route_unlock_node(rn);
 
-               /* Pick up selected route. */
-               RNODE_FOREACH_RE (rn, match) {
-                       if (CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED))
-                               continue;
-                       if (CHECK_FLAG(match->status, ROUTE_ENTRY_SELECTED_FIB))
-                               break;
-               }
+               dest = rib_dest_from_rnode(rn);
+               if (dest && dest->selected_fib &&
+                   !CHECK_FLAG(dest->selected_fib->status, ROUTE_ENTRY_REMOVED))
+                       match = dest->selected_fib;
 
                /* If there is no selected route or matched route is EGP, go up
                   tree. */
@@ -689,8 +684,9 @@ struct route_entry *rib_lookup_ipv4(struct prefix_ipv4 *p, vrf_id_t vrf_id)
 {
        struct route_table *table;
        struct route_node *rn;
-       struct route_entry *match;
+       struct route_entry *match = NULL;
        struct nexthop *nexthop;
+       rib_dest_t *dest;
 
        /* Lookup table.  */
        table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id);
@@ -705,13 +701,11 @@ struct route_entry *rib_lookup_ipv4(struct prefix_ipv4 *p, vrf_id_t vrf_id)
 
        /* Unlock node. */
        route_unlock_node(rn);
+       dest = rib_dest_from_rnode(rn);
 
-       RNODE_FOREACH_RE (rn, match) {
-               if (CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED))
-                       continue;
-               if (CHECK_FLAG(match->status, ROUTE_ENTRY_SELECTED_FIB))
-                       break;
-       }
+       if (dest && dest->selected_fib &&
+           !CHECK_FLAG(dest->selected_fib->status, ROUTE_ENTRY_REMOVED))
+               match = dest->selected_fib;
 
        if (!match)
                return NULL;
@@ -743,9 +737,10 @@ int rib_lookup_ipv4_route(struct prefix_ipv4 *p, union sockunion *qgate,
 {
        struct route_table *table;
        struct route_node *rn;
-       struct route_entry *match;
+       struct route_entry *match = NULL;
        struct nexthop *nexthop;
        int nexthops_active;
+       rib_dest_t *dest;
 
        /* Lookup table.  */
        table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id);
@@ -761,15 +756,13 @@ int rib_lookup_ipv4_route(struct prefix_ipv4 *p, union sockunion *qgate,
 
        /* Unlock node. */
        route_unlock_node(rn);
+       dest = rib_dest_from_rnode(rn);
 
        /* Find out if a "selected" RR for the discovered RIB entry exists ever.
         */
-       RNODE_FOREACH_RE (rn, match) {
-               if (CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED))
-                       continue;
-               if (CHECK_FLAG(match->status, ROUTE_ENTRY_SELECTED_FIB))
-                       break;
-       }
+       if (dest && dest->selected_fib &&
+           !CHECK_FLAG(dest->selected_fib->status, ROUTE_ENTRY_REMOVED))
+               match = dest->selected_fib;
 
        /* None such found :( */
        if (!match)
@@ -1115,8 +1108,9 @@ void rib_uninstall_kernel(struct route_node *rn, struct route_entry *re)
 static void rib_uninstall(struct route_node *rn, struct route_entry *re)
 {
        rib_table_info_t *info = srcdest_rnode_table_info(rn);
+       rib_dest_t *dest = rib_dest_from_rnode(rn);
 
-       if (CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB)) {
+       if (dest && dest->selected_fib == re) {
                if (info->safi == SAFI_UNICAST)
                        hook_call(rib_update, rn, "rib_uninstall");
 
@@ -1127,7 +1121,7 @@ static void rib_uninstall(struct route_node *rn, struct route_entry *re)
                if (zebra_rib_labeled_unicast(re))
                        zebra_mpls_lsp_uninstall(info->zvrf, rn, re);
 
-               UNSET_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB);
+               dest->selected_fib = NULL;
        }
 
        if (CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED)) {
@@ -1201,6 +1195,8 @@ int rib_gc_dest(struct route_node *rn)
 static void rib_process_add_fib(struct zebra_vrf *zvrf, struct route_node *rn,
                                struct route_entry *new)
 {
+       rib_dest_t *dest = rib_dest_from_rnode(rn);
+
        hook_call(rib_update, rn, "new route selected");
 
        /* Update real nexthop. This may actually determine if nexthop is active
@@ -1210,7 +1206,7 @@ static void rib_process_add_fib(struct zebra_vrf *zvrf, struct route_node *rn,
                return;
        }
 
-       SET_FLAG(new->status, ROUTE_ENTRY_SELECTED_FIB);
+       dest->selected_fib = new;
        if (IS_ZEBRA_DEBUG_RIB) {
                char buf[SRCDEST2STR_BUFFER];
                srcdest_rnode2str(rn, buf, sizeof(buf));
@@ -1231,6 +1227,7 @@ static void rib_process_add_fib(struct zebra_vrf *zvrf, struct route_node *rn,
 static void rib_process_del_fib(struct zebra_vrf *zvrf, struct route_node *rn,
                                struct route_entry *old)
 {
+       rib_dest_t *dest = rib_dest_from_rnode(rn);
        hook_call(rib_update, rn, "removing existing route");
 
        /* Uninstall from kernel. */
@@ -1248,7 +1245,7 @@ static void rib_process_del_fib(struct zebra_vrf *zvrf, struct route_node *rn,
        if (!RIB_SYSTEM_ROUTE(old))
                rib_uninstall_kernel(rn, old);
 
-       UNSET_FLAG(old->status, ROUTE_ENTRY_SELECTED_FIB);
+       dest->selected_fib = NULL;
 
        /* Update nexthop for route, reset changed flag. */
        nexthop_active_update(rn, old, 1);
@@ -1263,6 +1260,7 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
        struct nexthop *nexthop = NULL;
        int nh_active = 0;
        int installed = 1;
+       rib_dest_t *dest = rib_dest_from_rnode(rn);
 
        /*
         * We have to install or update if a new route has been selected or
@@ -1329,7 +1327,7 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
 
                        /* Update for redistribution. */
                        if (installed)
-                               SET_FLAG(new->status, ROUTE_ENTRY_SELECTED_FIB);
+                               dest->selected_fib = new;
                }
 
                /*
@@ -1364,7 +1362,7 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
 
                        if (!RIB_SYSTEM_ROUTE(old))
                                rib_uninstall_kernel(rn, old);
-                       UNSET_FLAG(new->status, ROUTE_ENTRY_SELECTED_FIB);
+                       dest->selected_fib = NULL;
                }
        } else {
                /*
@@ -1392,8 +1390,6 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
 
        /* Update prior route. */
        if (new != old) {
-               UNSET_FLAG(old->status, ROUTE_ENTRY_SELECTED_FIB);
-
                /* Set real nexthop. */
                nexthop_active_update(rn, old, 1);
                UNSET_FLAG(old->status, ROUTE_ENTRY_CHANGED);
@@ -1475,6 +1471,8 @@ static void rib_process(struct route_node *rn)
        if (IS_ZEBRA_DEBUG_RIB_DETAILED)
                zlog_debug("%u:%s: Processing rn %p", vrf_id, buf, rn);
 
+       old_fib = dest->selected_fib;
+
        RNODE_FOREACH_RE_SAFE (rn, re, next) {
                if (IS_ZEBRA_DEBUG_RIB_DETAILED)
                        zlog_debug(
@@ -1490,11 +1488,6 @@ static void rib_process(struct route_node *rn)
                        assert(old_selected == NULL);
                        old_selected = re;
                }
-               /* Currently in fib */
-               if (CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB)) {
-                       assert(old_fib == NULL);
-                       old_fib = re;
-               }
 
                /* Skip deleted entries from selection */
                if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
@@ -2183,8 +2176,8 @@ void rib_lookup_and_pushup(struct prefix_ipv4 *p, vrf_id_t vrf_id)
 {
        struct route_table *table;
        struct route_node *rn;
-       struct route_entry *re;
        unsigned changed = 0;
+       rib_dest_t *dest;
 
        if (NULL == (table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id))) {
                zlog_err("%s: zebra_vrf_table() returned NULL", __func__);
@@ -2198,6 +2191,7 @@ void rib_lookup_and_pushup(struct prefix_ipv4 *p, vrf_id_t vrf_id)
        /* Unlock node. */
        route_unlock_node(rn);
 
+       dest = rib_dest_from_rnode(rn);
        /* Check all RE entries. In case any changes have to be done, requeue
         * the RN into RIBQ head. If the routing message about the new connected
         * route (generated by the IP address we are going to assign very soon)
@@ -2206,20 +2200,17 @@ void rib_lookup_and_pushup(struct prefix_ipv4 *p, vrf_id_t vrf_id)
         * revalidation
         * of the rest of the RE.
         */
-       RNODE_FOREACH_RE (rn, re) {
-               if (CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB)
-                   && !RIB_SYSTEM_ROUTE(re)) {
-                       changed = 1;
-                       if (IS_ZEBRA_DEBUG_RIB) {
-                               char buf[PREFIX_STRLEN];
-                               zlog_debug(
-                                       "%u:%s: freeing way for connected prefix",
-                                       re->vrf_id,
-                                       prefix2str(&rn->p, buf, sizeof(buf)));
-                               route_entry_dump(&rn->p, NULL, re);
-                       }
-                       rib_uninstall(rn, re);
+       if (dest->selected_fib && !RIB_SYSTEM_ROUTE(dest->selected_fib)) {
+               changed = 1;
+               if (IS_ZEBRA_DEBUG_RIB) {
+                       char buf[PREFIX_STRLEN];
+
+                       zlog_debug("%u:%s: freeing way for connected prefix",
+                                  dest->selected_fib->vrf_id,
+                                  prefix2str(&rn->p, buf, sizeof(buf)));
+                       route_entry_dump(&rn->p, NULL, dest->selected_fib);
                }
+               rib_uninstall(rn, dest->selected_fib);
        }
        if (changed)
                rib_queue_add(rn);
@@ -2325,6 +2316,7 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
        struct route_entry *same = NULL;
        struct nexthop *rtnh;
        char buf2[INET6_ADDRSTRLEN];
+       rib_dest_t *dest;
 
        assert(!src_p || afi == AFI_IP6);
 
@@ -2357,14 +2349,14 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
                return;
        }
 
+       dest = rib_dest_from_rnode(rn);
+       fib = dest->selected_fib;
+
        /* Lookup same type route. */
        RNODE_FOREACH_RE (rn, re) {
                if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
                        continue;
 
-               if (CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB))
-                       fib = re;
-
                if (re->type != type)
                        continue;
                if (re->instance != instance)
@@ -2427,8 +2419,7 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
                                        UNSET_FLAG(rtnh->flags,
                                                   NEXTHOP_FLAG_FIB);
 
-                               UNSET_FLAG(fib->status,
-                                          ROUTE_ENTRY_SELECTED_FIB);
+                               dest->selected_fib = NULL;
                        } else {
                                /* This means someone else, other than Zebra,
                                 * has deleted
@@ -2480,7 +2471,7 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
 int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, u_short instance,
            int flags, struct prefix *p, struct prefix_ipv6 *src_p,
            const struct nexthop *nh, u_int32_t table_id, u_int32_t metric,
-           u_int32_t mtu, uint8_t distance)
+           u_int32_t mtu, uint8_t distance, route_tag_t tag)
 {
        struct route_entry *re;
        struct nexthop *nexthop;
@@ -2497,6 +2488,7 @@ int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, u_short instance,
        re->vrf_id = vrf_id;
        re->nexthop_num = 0;
        re->uptime = time(NULL);
+       re->tag = tag;
 
        /* Add nexthop. */
        nexthop = nexthop_new();
@@ -2740,24 +2732,24 @@ void rib_close_table(struct route_table *table)
 {
        struct route_node *rn;
        rib_table_info_t *info;
-       struct route_entry *re;
+       rib_dest_t *dest;
 
        if (!table)
                return;
 
        info = table->info;
 
-       for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
-               RNODE_FOREACH_RE (rn, re) {
-                       if (!CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB))
-                               continue;
+       for (rn = route_top(table); rn; rn = srcdest_route_next(rn)) {
+               dest = rib_dest_from_rnode(rn);
 
+               if (dest && dest->selected_fib) {
                        if (info->safi == SAFI_UNICAST)
                                hook_call(rib_update, rn, NULL);
 
-                       if (!RIB_SYSTEM_ROUTE(re))
-                               rib_uninstall_kernel(rn, re);
+                       if (!RIB_SYSTEM_ROUTE(dest->selected_fib))
+                               rib_uninstall_kernel(rn, dest->selected_fib);
                }
+       }
 }
 
 /* Routing information base initialize. */
index 5927ba9d750e5146eec12125b3f308f55dc4b40d..751ea08a381eecbf0e0348b1351bd7ae77d53aa8 100644 (file)
@@ -331,11 +331,12 @@ void static_uninstall_route(afi_t afi, safi_t safi, struct prefix *p,
                }
                UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE);
                if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB)) {
+                       rib_dest_t *dest = rib_dest_from_rnode(rn);
+
                        /* If there are other active nexthops, do an update. */
                        if (re->nexthop_active_num > 1) {
                                /* Update route in kernel if it's in fib */
-                               if (CHECK_FLAG(re->status,
-                                              ROUTE_ENTRY_SELECTED_FIB))
+                               if (dest->selected_fib)
                                        rib_install_kernel(rn, re, re);
                                /* Update redistribution if it's selected */
                                if (CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED))
@@ -350,8 +351,7 @@ void static_uninstall_route(afi_t afi, safi_t safi, struct prefix *p,
                                                p, (struct prefix *)src_p, re);
                                /* Remove from kernel if fib route becomes
                                 * inactive */
-                               if (CHECK_FLAG(re->status,
-                                              ROUTE_ENTRY_SELECTED_FIB))
+                               if (dest->selected_fib)
                                        rib_uninstall_kernel(rn, re);
                        }
                }
index e4407d731691f22719b10eff7481e059b0ef14a6..ccd0c703d49e1c649eae4a548369f5f8cd7d36f2 100644 (file)
@@ -474,8 +474,13 @@ static void vty_show_ip_route_detail(struct vty *vty, struct route_node *rn,
                vty_out(vty, "\"");
                vty_out(vty, ", distance %u, metric %u", re->distance,
                        re->metric);
-               if (re->tag)
+               if (re->tag) {
                        vty_out(vty, ", tag %u", re->tag);
+#if defined(SUPPORT_REALMS)
+                       if (re->tag > 0 && re->tag <= 255)
+                               vty_out(vty, "(realm)");
+#endif
+               }
                if (re->mtu)
                        vty_out(vty, ", mtu %u", re->mtu);
                if (re->vrf_id != VRF_DEFAULT) {
@@ -963,6 +968,7 @@ static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi,
                            u_short ospf_instance_id)
 {
        struct route_table *table;
+       rib_dest_t *dest;
        struct route_node *rn;
        struct route_entry *re;
        int first = 1;
@@ -1000,10 +1006,11 @@ static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi,
 
        /* Show all routes. */
        for (rn = route_top(table); rn; rn = route_next(rn)) {
+               dest = rib_dest_from_rnode(rn);
+
                RNODE_FOREACH_RE (rn, re) {
                        if (use_fib
-                           && !CHECK_FLAG(re->status,
-                                          ROUTE_ENTRY_SELECTED_FIB))
+                           && re != dest->selected_fib)
                                continue;
 
                        if (tag && re->tag != tag)