ip-neighbor: suppress unsolicited clib_warning when sending garp 15/31715/2
authorSteven Luong <sluong@cisco.com>
Tue, 23 Mar 2021 18:55:33 +0000 (11:55 -0700)
committerBeno�t Ganne <bganne@cisco.com>
Fri, 2 Apr 2021 08:42:10 +0000 (08:42 +0000)
Replace clib_warning with vlog_log_debug when sending garp. There is nothing
to alert/warn the operator about sending garp. vlib_log is more appropriate.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ib88a2b46d2ab8b3c35162538ead0dd0983fb7093

src/vnet/ip-neighbor/ip4_neighbor.c
src/vnet/ip-neighbor/ip6_neighbor.c

index c268b96..9484825 100644 (file)
 /** ARP throttling */
 static throttle_t arp_throttle;
 
+VLIB_REGISTER_LOG_CLASS (ip4_neighbor_log, static) = {
+  .class_name = "ip4",
+  .subclass_name = "neighbor",
+};
+
+#define log_debug(fmt, ...)                                                   \
+  vlib_log_debug (ip4_neighbor_log.class, fmt, __VA_ARGS__)
+
 void
 ip4_neighbor_probe_dst (u32 sw_if_index, const ip4_address_t * dst)
 {
@@ -77,8 +85,8 @@ ip4_neighbor_advertise (vlib_main_t * vm,
 
   if (addr)
     {
-      clib_warning ("Sending GARP for IP4 address %U on sw_if_idex %d",
-                   format_ip4_address, addr, sw_if_index);
+      log_debug ("Sending GARP for IP4 address %U on sw_if_idex %d",
+                format_ip4_address, addr, sw_if_index);
 
       /* Form GARP packet for output - Gratuitous ARP is an ARP request packet
          where the interface IP/MAC pair is used for both source and request
index 478eca7..ec32354 100644 (file)
 /** ND throttling */
 static throttle_t nd_throttle;
 
+VLIB_REGISTER_LOG_CLASS (ip6_neighbor_log, static) = {
+  .class_name = "ip6",
+  .subclass_name = "neighbor",
+};
+
+#define log_debug(fmt, ...)                                                   \
+  vlib_log_debug (ip6_neighbor_log.class, fmt, __VA_ARGS__)
 void
 ip6_neighbor_probe_dst (u32 sw_if_index, const ip6_address_t * dst)
 {
@@ -47,9 +54,8 @@ ip6_neighbor_advertise (vlib_main_t * vm,
 
   if (addr)
     {
-      clib_warning
-       ("Sending unsolicitated NA IP6 address %U on sw_if_idex %d",
-        format_ip6_address, addr, sw_if_index);
+      log_debug ("Sending unsolicitated NA IP6 address %U on sw_if_idex %d",
+                format_ip6_address, addr, sw_if_index);
 
       /* Form unsolicited neighbor advertisement packet from NS pkt template */
       int bogus_length;