]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/rule_netlink.c
isisd: implement the 'lsp-too-large' notification
[mirror_frr.git] / zebra / rule_netlink.c
index c7a8517e17c73c0ea496db700a5df9db85d24960..7686a0ac32bc6d22a2bf8c1b013dce83ffbd86b9 100644 (file)
@@ -40,6 +40,7 @@
 #include "zebra/kernel_netlink.h"
 #include "zebra/rule_netlink.h"
 #include "zebra/zebra_pbr.h"
+#include "zebra/zebra_errors.h"
 
 /* definitions */
 
@@ -142,31 +143,31 @@ static int netlink_rule_update(int cmd, struct zebra_pbr_rule *rule)
  * goes in the rule to denote relative ordering; it may or may not be the
  * same as the rule's user-defined sequence number.
  */
-enum dp_req_result kernel_add_pbr_rule(struct zebra_pbr_rule *rule)
+enum zebra_dplane_result kernel_add_pbr_rule(struct zebra_pbr_rule *rule)
 {
        int ret = 0;
 
        ret = netlink_rule_update(RTM_NEWRULE, rule);
        kernel_pbr_rule_add_del_status(rule,
-                                      (!ret) ? DP_INSTALL_SUCCESS
-                                             : DP_INSTALL_FAILURE);
+                                      (!ret) ? ZEBRA_DPLANE_INSTALL_SUCCESS
+                                             : ZEBRA_DPLANE_INSTALL_FAILURE);
 
-       return DP_REQUEST_SUCCESS;
+       return ZEBRA_DPLANE_REQUEST_SUCCESS;
 }
 
 /*
  * Uninstall specified rule for a specific interface.
  */
-enum dp_req_result kernel_del_pbr_rule(struct zebra_pbr_rule *rule)
+enum zebra_dplane_result kernel_del_pbr_rule(struct zebra_pbr_rule *rule)
 {
        int ret = 0;
 
        ret = netlink_rule_update(RTM_DELRULE, rule);
        kernel_pbr_rule_add_del_status(rule,
-                                      (!ret) ? DP_DELETE_SUCCESS
-                                             : DP_DELETE_FAILURE);
+                                      (!ret) ? ZEBRA_DPLANE_DELETE_SUCCESS
+                                             : ZEBRA_DPLANE_DELETE_FAILURE);
 
-       return DP_REQUEST_SUCCESS;
+       return ZEBRA_DPLANE_REQUEST_SUCCESS;
 }
 
 /*
@@ -204,8 +205,13 @@ int netlink_rule_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
        }
 
        frh = NLMSG_DATA(h);
-       if (frh->family != AF_INET && frh->family != AF_INET6)
+       if (frh->family != AF_INET && frh->family != AF_INET6) {
+               flog_warn(
+                       EC_ZEBRA_NETLINK_INVALID_AF,
+                       "Invalid address family: %u received from kernel rule change: %u",
+                       frh->family, h->nlmsg_type);
                return 0;
+       }
        if (frh->action != FR_ACT_TO_TBL)
                return 0;