diff options
Diffstat (limited to 'bgpd/bgp_pbr.c')
| -rw-r--r-- | bgpd/bgp_pbr.c | 59 |
1 files changed, 19 insertions, 40 deletions
diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c index 535a45690b..7c3e8cd70e 100644 --- a/bgpd/bgp_pbr.c +++ b/bgpd/bgp_pbr.c @@ -486,8 +486,7 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api) */ if (api->match_protocol_num > 1) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match protocol operations:" - "multiple protocols ( %d). ignoring.", + zlog_debug("BGP: match protocol operations:multiple protocols ( %d). ignoring.", api->match_protocol_num); return 0; } @@ -496,21 +495,18 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api) api->protocol[0].value != PROTOCOL_ICMP && api->protocol[0].value != PROTOCOL_TCP) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match protocol operations:" - "protocol (%d) not supported. ignoring", + zlog_debug("BGP: match protocol operations:protocol (%d) not supported. ignoring", api->match_protocol_num); return 0; } if (!bgp_pbr_extract(api->src_port, api->match_src_port_num, NULL)) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match src port operations:" - "too complex. ignoring."); + zlog_debug("BGP: match src port operations:too complex. ignoring."); return 0; } if (!bgp_pbr_extract(api->dst_port, api->match_dst_port_num, NULL)) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match dst port operations:" - "too complex. ignoring."); + zlog_debug("BGP: match dst port operations:too complex. ignoring."); return 0; } if (!bgp_pbr_extract_enumerate(api->tcpflags, @@ -519,8 +515,7 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api) OPERATOR_UNARY_OR, NULL, FLOWSPEC_TCP_FLAGS)) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match tcp flags:" - "too complex. ignoring."); + zlog_debug("BGP: match tcp flags:too complex. ignoring."); return 0; } if (!bgp_pbr_extract(api->icmp_type, api->match_icmp_type_num, NULL)) { @@ -529,8 +524,7 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api) OPERATOR_UNARY_OR, NULL, FLOWSPEC_ICMP_TYPE)) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match icmp type operations:" - "too complex. ignoring."); + zlog_debug("BGP: match icmp type operations:too complex. ignoring."); return 0; } enumerate_icmp = true; @@ -541,22 +535,18 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api) OPERATOR_UNARY_OR, NULL, FLOWSPEC_ICMP_CODE)) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match icmp code operations:" - "too complex. ignoring."); + zlog_debug("BGP: match icmp code operations:too complex. ignoring."); return 0; } else if (api->match_icmp_type_num > 1 && !enumerate_icmp) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match icmp code is enumerate" - ", and icmp type is not." - " too complex. ignoring."); + zlog_debug("BGP: match icmp code is enumerate, and icmp type is not. too complex. ignoring."); return 0; } } if (!bgp_pbr_extract(api->port, api->match_port_num, NULL)) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match port operations:" - "too complex. ignoring."); + zlog_debug("BGP: match port operations:too complex. ignoring."); return 0; } if (api->match_packet_length_num) { @@ -572,8 +562,7 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api) NULL, FLOWSPEC_PKT_LEN); if (!ret) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match packet length operations:" - "too complex. ignoring."); + zlog_debug("BGP: match packet length operations:too complex. ignoring."); return 0; } } @@ -582,8 +571,7 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api) OPERATOR_UNARY_OR | OPERATOR_UNARY_AND, NULL, FLOWSPEC_DSCP)) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match DSCP operations:" - "too complex. ignoring."); + zlog_debug("BGP: match DSCP operations:too complex. ignoring."); return 0; } } @@ -629,16 +617,14 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api) if (api->match_src_port_num + api->match_dst_port_num + api->match_port_num > 3) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match multiple port operations:" - " too complex. ignoring."); + zlog_debug("BGP: match multiple port operations: too complex. ignoring."); return 0; } if ((api->match_src_port_num || api->match_dst_port_num || api->match_port_num) && (api->match_icmp_type_num || api->match_icmp_code_num)) { if (BGP_DEBUG(pbr, PBR)) - zlog_debug("BGP: match multiple port/imcp operations:" - " too complex. ignoring."); + zlog_debug("BGP: match multiple port/imcp operations: too complex. ignoring."); return 0; } /* iprule only supports redirect IP */ @@ -650,24 +636,21 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api) api->actions[i].u.r.rate == 0) { if (BGP_DEBUG(pbr, PBR)) { bgp_pbr_print_policy_route(api); - zlog_debug("BGP: iprule match actions" - " drop not supported"); + zlog_debug("BGP: iprule match actions drop not supported"); } return 0; } if (api->actions[i].action == ACTION_MARKING) { if (BGP_DEBUG(pbr, PBR)) { bgp_pbr_print_policy_route(api); - zlog_warn("PBR: iprule set DSCP %u" - " not supported", + zlog_warn("PBR: iprule set DSCP %u not supported", api->actions[i].u.marking_dscp); } } if (api->actions[i].action == ACTION_REDIRECT) { if (BGP_DEBUG(pbr, PBR)) { bgp_pbr_print_policy_route(api); - zlog_warn("PBR: iprule redirect VRF %u" - " not supported", + zlog_warn("PBR: iprule redirect VRF %u not supported", api->actions[i].u.redirect_vrf); } } @@ -677,9 +660,7 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api) !(api->match_bitmask & PREFIX_DST_PRESENT)) { if (BGP_DEBUG(pbr, PBR)) { bgp_pbr_print_policy_route(api); - zlog_debug("BGP: match actions without src" - " or dst address can not operate." - " ignoring."); + zlog_debug("BGP: match actions without src or dst address can not operate. ignoring."); } return 0; } @@ -845,8 +826,7 @@ int bgp_pbr_build_and_validate_entry(const struct prefix *p, if (valid_prefix && afi != family2afi(dst->family)) { if (BGP_DEBUG(pbr, PBR)) { bgp_pbr_print_policy_route(api); - zlog_debug("%s: inconsistency:" - " no match for afi src and dst (%u/%u)", + zlog_debug("%s: inconsistency: no match for afi src and dst (%u/%u)", __func__, afi, family2afi(dst->family)); } return -1; @@ -2097,8 +2077,7 @@ static void bgp_pbr_policyroute_add_to_zebra_unit(struct bgp *bgp, listnode_lookup_nocheck(extra->bgp_fs_iprule, bpr)) { if (BGP_DEBUG(pbr, PBR_ERROR)) - zlog_err("%s: entry %p/%p already " - "installed in bgp pbr iprule", + zlog_err("%s: entry %p/%p already installed in bgp pbr iprule", __func__, path, bpr); return; } |
