summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-02-13 14:21:26 +0100
committerDonatas Abraitis <donatas.abraitis@gmail.com>2020-02-13 14:39:54 +0100
commit752022670a294584ce45161a182f5b5790da45b9 (patch)
treed8bf19c32a08a1dd4ba2799ed2fee8450fe735e1
parentMerge pull request #5798 from donaldsharp/bgp_packet_reformat (diff)
downloadfrr-752022670a294584ce45161a182f5b5790da45b9.tar.xz
frr-752022670a294584ce45161a182f5b5790da45b9.zip
*: Remove break after return
Just a deadcode. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
-rw-r--r--babeld/kernel.c3
-rw-r--r--bgpd/bgp_route.c22
-rw-r--r--bgpd/bgp_snmp.c39
-rw-r--r--bgpd/bgp_vty.c12
-rw-r--r--bgpd/bgpd.h15
-rw-r--r--bgpd/rfapi/rfapi_import.c3
-rw-r--r--eigrpd/eigrp_routemap.c7
-rw-r--r--eigrpd/eigrp_snmp.c73
-rw-r--r--isisd/isis_spf.c10
-rw-r--r--lib/filter.c4
-rw-r--r--lib/plist.c1
-rw-r--r--lib/prefix.c3
-rw-r--r--lib/routemap.c3
-rw-r--r--lib/sockopt.c2
-rw-r--r--lib/sockunion.c1
-rw-r--r--lib/vty.c3
-rw-r--r--lib/zclient.c2
-rw-r--r--ospf6d/ospf6_asbr.c2
-rw-r--r--ospf6d/ospf6_snmp.c4
-rw-r--r--ospfd/ospf_packet.c1
-rw-r--r--ospfd/ospf_snmp.c127
-rw-r--r--pimd/pim_ifchannel.c6
-rw-r--r--pimd/pim_macro.c2
-rw-r--r--pimd/pim_pim.c2
-rw-r--r--pimd/pim_register.c2
-rw-r--r--pimd/pim_rpf.c6
-rw-r--r--pimd/pim_tlv.c5
-rw-r--r--pimd/pim_upstream.c2
-rw-r--r--ripd/rip_snmp.c4
-rw-r--r--vtysh/vtysh.c2
-rw-r--r--zebra/interface.c7
-rw-r--r--zebra/zebra_fpm_netlink.c5
-rw-r--r--zebra/zebra_mpls.c1
-rw-r--r--zebra/zebra_snmp.c17
34 files changed, 1 insertions, 397 deletions
diff --git a/babeld/kernel.c b/babeld/kernel.c
index d4c962af3..e3c76bdd9 100644
--- a/babeld/kernel.c
+++ b/babeld/kernel.c
@@ -103,10 +103,8 @@ kernel_route(enum babel_kernel_routes operation, const unsigned char *pref,
switch (operation) {
case ROUTE_ADD:
return zebra_route(1, family, pref, plen, gate, ifindex, metric);
- break;
case ROUTE_FLUSH:
return zebra_route(0, family, pref, plen, gate, ifindex, metric);
- break;
case ROUTE_MODIFY:
if(newmetric == metric && memcmp(newgate, gate, 16) == 0 &&
newifindex == ifindex)
@@ -119,7 +117,6 @@ kernel_route(enum babel_kernel_routes operation, const unsigned char *pref,
rc = zebra_route(1, family, pref, plen, newgate, newifindex,
newmetric);
return rc;
- break;
}
return 0;
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 34580788b..755024f4b 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -8445,70 +8445,48 @@ static const char *bgp_path_selection_reason2str(
switch (reason) {
case bgp_path_selection_none:
return "Nothing to Select";
- break;
case bgp_path_selection_first:
return "First path received";
- break;
case bgp_path_selection_evpn_sticky_mac:
return "EVPN Sticky Mac";
- break;
case bgp_path_selection_evpn_seq:
return "EVPN sequence number";
- break;
case bgp_path_selection_evpn_lower_ip:
return "EVPN lower IP";
- break;
case bgp_path_selection_weight:
return "Weight";
- break;
case bgp_path_selection_local_pref:
return "Local Pref";
- break;
case bgp_path_selection_local_route:
return "Local Route";
- break;
case bgp_path_selection_confed_as_path:
return "Confederation based AS Path";
- break;
case bgp_path_selection_as_path:
return "AS Path";
- break;
case bgp_path_selection_origin:
return "Origin";
- break;
case bgp_path_selection_med:
return "MED";
- break;
case bgp_path_selection_peer:
return "Peer Type";
- break;
case bgp_path_selection_confed:
return "Confed Peer Type";
- break;
case bgp_path_selection_igp_metric:
return "IGP Metric";
- break;
case bgp_path_selection_older:
return "Older Path";
- break;
case bgp_path_selection_router_id:
return "Router ID";
- break;
case bgp_path_selection_cluster_length:
return "Cluser length";
- break;
case bgp_path_selection_stale:
return "Path Staleness";
- break;
case bgp_path_selection_local_configured:
return "Locally configured route";
- break;
case bgp_path_selection_neighbor_ip:
return "Neighbor IP";
- break;
case bgp_path_selection_default:
return "Nothing left to compare";
- break;
}
return "Invalid (internal error)";
}
diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c
index 77b547c0a..70e4a3fa0 100644
--- a/bgpd/bgp_snmp.c
+++ b/bgpd/bgp_snmp.c
@@ -528,10 +528,8 @@ static uint8_t *bgpPeerTable(struct variable *v, oid name[], size_t *length,
switch (v->magic) {
case BGPPEERIDENTIFIER:
return SNMP_IPADDRESS(peer->remote_id);
- break;
case BGPPEERSTATE:
return SNMP_INTEGER(peer->status);
- break;
case BGPPEERADMINSTATUS:
*write_method = write_bgpPeerTable;
#define BGP_PeerAdmin_stop 1
@@ -540,108 +538,87 @@ static uint8_t *bgpPeerTable(struct variable *v, oid name[], size_t *length,
return SNMP_INTEGER(BGP_PeerAdmin_stop);
else
return SNMP_INTEGER(BGP_PeerAdmin_start);
- break;
case BGPPEERNEGOTIATEDVERSION:
return SNMP_INTEGER(BGP_VERSION_4);
- break;
case BGPPEERLOCALADDR:
if (peer->su_local)
return SNMP_IPADDRESS(peer->su_local->sin.sin_addr);
else
return SNMP_IPADDRESS(bgp_empty_addr);
- break;
case BGPPEERLOCALPORT:
if (peer->su_local)
return SNMP_INTEGER(
ntohs(peer->su_local->sin.sin_port));
else
return SNMP_INTEGER(0);
- break;
case BGPPEERREMOTEADDR:
if (peer->su_remote)
return SNMP_IPADDRESS(peer->su_remote->sin.sin_addr);
else
return SNMP_IPADDRESS(bgp_empty_addr);
- break;
case BGPPEERREMOTEPORT:
if (peer->su_remote)
return SNMP_INTEGER(
ntohs(peer->su_remote->sin.sin_port));
else
return SNMP_INTEGER(0);
- break;
case BGPPEERREMOTEAS:
return SNMP_INTEGER(peer->as);
- break;
case BGPPEERINUPDATES:
ui = atomic_load_explicit(&peer->update_in,
memory_order_relaxed);
return SNMP_INTEGER(ui);
- break;
case BGPPEEROUTUPDATES:
uo = atomic_load_explicit(&peer->update_out,
memory_order_relaxed);
return SNMP_INTEGER(uo);
- break;
case BGPPEERINTOTALMESSAGES:
return SNMP_INTEGER(PEER_TOTAL_RX(peer));
- break;
case BGPPEEROUTTOTALMESSAGES:
return SNMP_INTEGER(PEER_TOTAL_TX(peer));
- break;
case BGPPEERLASTERROR: {
static uint8_t lasterror[2];
lasterror[0] = peer->notify.code;
lasterror[1] = peer->notify.subcode;
*var_len = 2;
return (uint8_t *)&lasterror;
- } break;
+ }
case BGPPEERFSMESTABLISHEDTRANSITIONS:
return SNMP_INTEGER(peer->established);
- break;
case BGPPEERFSMESTABLISHEDTIME:
if (peer->uptime == 0)
return SNMP_INTEGER(0);
else
return SNMP_INTEGER(bgp_clock() - peer->uptime);
- break;
case BGPPEERCONNECTRETRYINTERVAL:
*write_method = write_bgpPeerTable;
return SNMP_INTEGER(peer->v_connect);
- break;
case BGPPEERHOLDTIME:
return SNMP_INTEGER(peer->v_holdtime);
- break;
case BGPPEERKEEPALIVE:
return SNMP_INTEGER(peer->v_keepalive);
- break;
case BGPPEERHOLDTIMECONFIGURED:
*write_method = write_bgpPeerTable;
if (CHECK_FLAG(peer->flags, PEER_FLAG_TIMER))
return SNMP_INTEGER(peer->holdtime);
else
return SNMP_INTEGER(peer->v_holdtime);
- break;
case BGPPEERKEEPALIVECONFIGURED:
*write_method = write_bgpPeerTable;
if (CHECK_FLAG(peer->flags, PEER_FLAG_TIMER))
return SNMP_INTEGER(peer->keepalive);
else
return SNMP_INTEGER(peer->v_keepalive);
- break;
case BGPPEERMINROUTEADVERTISEMENTINTERVAL:
*write_method = write_bgpPeerTable;
return SNMP_INTEGER(peer->v_routeadv);
- break;
case BGPPEERINUPDATEELAPSEDTIME:
if (peer->update_time == 0)
return SNMP_INTEGER(0);
else
return SNMP_INTEGER(bgp_clock() - peer->update_time);
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -834,40 +811,28 @@ static uint8_t *bgp4PathAttrTable(struct variable *v, oid name[],
switch (v->magic) {
case BGP4PATHATTRPEER: /* 1 */
return SNMP_IPADDRESS(path->peer->su.sin.sin_addr);
- break;
case BGP4PATHATTRIPADDRPREFIXLEN: /* 2 */
return SNMP_INTEGER(addr.prefixlen);
- break;
case BGP4PATHATTRIPADDRPREFIX: /* 3 */
return SNMP_IPADDRESS(addr.prefix);
- break;
case BGP4PATHATTRORIGIN: /* 4 */
return SNMP_INTEGER(path->attr->origin);
- break;
case BGP4PATHATTRASPATHSEGMENT: /* 5 */
return aspath_snmp_pathseg(path->attr->aspath, var_len);
- break;
case BGP4PATHATTRNEXTHOP: /* 6 */
return SNMP_IPADDRESS(path->attr->nexthop);
- break;
case BGP4PATHATTRMULTIEXITDISC: /* 7 */
return SNMP_INTEGER(path->attr->med);
- break;
case BGP4PATHATTRLOCALPREF: /* 8 */
return SNMP_INTEGER(path->attr->local_pref);
- break;
case BGP4PATHATTRATOMICAGGREGATE: /* 9 */
return SNMP_INTEGER(1);
- break;
case BGP4PATHATTRAGGREGATORAS: /* 10 */
return SNMP_INTEGER(path->attr->aggregator_as);
- break;
case BGP4PATHATTRAGGREGATORADDR: /* 11 */
return SNMP_IPADDRESS(path->attr->aggregator_addr);
- break;
case BGP4PATHATTRCALCLOCALPREF: /* 12 */
return SNMP_INTEGER(-1);
- break;
case BGP4PATHATTRBEST: /* 13 */
#define BGP4_PathAttrBest_false 1
#define BGP4_PathAttrBest_true 2
@@ -875,11 +840,9 @@ static uint8_t *bgp4PathAttrTable(struct variable *v, oid name[],
return SNMP_INTEGER(BGP4_PathAttrBest_true);
else
return SNMP_INTEGER(BGP4_PathAttrBest_false);
- break;
case BGP4PATHATTRUNKNOWN: /* 14 */
*var_len = 0;
return NULL;
- break;
}
return NULL;
}
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index f57f0036d..f1987c58e 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -142,54 +142,42 @@ static enum node_type bgp_node_type(afi_t afi, safi_t safi)
switch (safi) {
case SAFI_UNICAST:
return BGP_IPV4_NODE;
- break;
case SAFI_MULTICAST:
return BGP_IPV4M_NODE;
- break;
case SAFI_LABELED_UNICAST:
return BGP_IPV4L_NODE;
- break;
case SAFI_MPLS_VPN:
return BGP_VPNV4_NODE;
- break;
case SAFI_FLOWSPEC:
return BGP_FLOWSPECV4_NODE;
default:
/* not expected */
return BGP_IPV4_NODE;
- break;
}
break;
case AFI_IP6:
switch (safi) {
case SAFI_UNICAST:
return BGP_IPV6_NODE;
- break;
case SAFI_MULTICAST:
return BGP_IPV6M_NODE;
- break;
case SAFI_LABELED_UNICAST:
return BGP_IPV6L_NODE;
- break;
case SAFI_MPLS_VPN:
return BGP_VPNV6_NODE;
- break;
case SAFI_FLOWSPEC:
return BGP_FLOWSPECV6_NODE;
default:
/* not expected */
return BGP_IPV4_NODE;
- break;
}
break;
case AFI_L2VPN:
return BGP_EVPN_NODE;
- break;
case AFI_UNSPEC:
case AFI_MAX:
// We should never be here but to clarify the switch statement..
return BGP_IPV4_NODE;
- break;
}
// Impossible to happen
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 548dfe468..d47ae7158 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -1965,62 +1965,47 @@ static inline int afindex(afi_t afi, safi_t safi)
switch (safi) {
case SAFI_UNICAST:
return BGP_AF_IPV4_UNICAST;
- break;
case SAFI_MULTICAST:
return BGP_AF_IPV4_MULTICAST;
- break;
case SAFI_LABELED_UNICAST:
return BGP_AF_IPV4_LBL_UNICAST;
- break;
case SAFI_MPLS_VPN:
return BGP_AF_IPV4_VPN;
- break;
case SAFI_ENCAP:
return BGP_AF_IPV4_ENCAP;
- break;
case SAFI_FLOWSPEC:
return BGP_AF_IPV4_FLOWSPEC;
default:
return BGP_AF_MAX;
- break;
}
break;
case AFI_IP6:
switch (safi) {
case SAFI_UNICAST:
return BGP_AF_IPV6_UNICAST;
- break;
case SAFI_MULTICAST:
return BGP_AF_IPV6_MULTICAST;
- break;
case SAFI_LABELED_UNICAST:
return BGP_AF_IPV6_LBL_UNICAST;
- break;
case SAFI_MPLS_VPN:
return BGP_AF_IPV6_VPN;
- break;
case SAFI_ENCAP:
return BGP_AF_IPV6_ENCAP;
- break;
case SAFI_FLOWSPEC:
return BGP_AF_IPV6_FLOWSPEC;
default:
return BGP_AF_MAX;
- break;
}
break;
case AFI_L2VPN:
switch (safi) {
case SAFI_EVPN:
return BGP_AF_L2VPN_EVPN;
- break;
default:
return BGP_AF_MAX;
- break;
}
default:
return BGP_AF_MAX;
- break;
}
}
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c
index 61cbae167..8fbc4d9d1 100644
--- a/bgpd/rfapi/rfapi_import.c
+++ b/bgpd/rfapi/rfapi_import.c
@@ -1092,7 +1092,6 @@ static int rfapiVpnBiNhEqualsPt(struct bgp_path_info *bpi,
default:
return 0;
- break;
}
return 1;
@@ -1135,7 +1134,6 @@ static int rfapiVpnBiSamePtUn(struct bgp_path_info *bpi1,
default:
return 0;
- break;
}
memset(&pfx_un1, 0, sizeof(pfx_un1));
@@ -1427,7 +1425,6 @@ rfapiRouteInfo2NextHopEntry(struct rfapi_ip_prefix *rprefix,
__func__, new->un_address.addr_family, bpi);
rfapi_free_next_hop_list(new);
return NULL;
- break;
}
}
diff --git a/eigrpd/eigrp_routemap.c b/eigrpd/eigrp_routemap.c
index df7b9c94e..99cc34d3d 100644
--- a/eigrpd/eigrp_routemap.c
+++ b/eigrpd/eigrp_routemap.c
@@ -142,11 +142,9 @@ static int eigrp_route_match_add(struct vty *vty, struct route_map_index *index,
case RMAP_RULE_MISSING:
vty_out(vty, "%% Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED;
- break;
case RMAP_COMPILE_ERROR:
vty_out(vty, "%% Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED;
- break;
case RMAP_COMPILE_SUCCESS:
/*
* Intentionally not handling these cases
@@ -169,11 +167,9 @@ static int eigrp_route_match_delete(struct vty *vty,
case RMAP_RULE_MISSING:
vty_out(vty, "%% Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED;
- break;
case RMAP_COMPILE_ERROR:
vty_out(vty, "%% Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED;
- break;
case RMAP_COMPILE_SUCCESS:
/*
* These cases intentionally ignored
@@ -195,7 +191,6 @@ static int eigrp_route_set_add(struct vty *vty, struct route_map_index *index,
case RMAP_RULE_MISSING:
vty_out(vty, "%% Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED;
- break;
case RMAP_COMPILE_ERROR:
/*
* rip, ripng and other protocols share the set metric command
@@ -230,11 +225,9 @@ static int eigrp_route_set_delete(struct vty *vty,
case RMAP_RULE_MISSING:
vty_out(vty, "%% Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED;
- break;
case RMAP_COMPILE_ERROR:
vty_out(vty, "%% Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED;
- break;
case RMAP_COMPILE_SUCCESS:
/*
* These cases intentionally not handled
diff --git a/eigrpd/eigrp_snmp.c b/eigrpd/eigrp_snmp.c
index 21c92386a..3b232be38 100644
--- a/eigrpd/eigrp_snmp.c
+++ b/eigrpd/eigrp_snmp.c
@@ -619,14 +619,12 @@ static uint8_t *eigrpVpnEntry(struct variable *v, oid *name, size_t *length,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPVPNNAME: /* 2 */
/* The name given to the VPN */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
default:
return NULL;
}
@@ -680,14 +678,12 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(eigrp->AS);
else
return SNMP_INTEGER(0);
- break;
case EIGRPNBRCOUNT: /* 2 */
/* Neighbor count of this EIGRP instance */
if (eigrp)
return SNMP_INTEGER(eigrp_neighbor_count(eigrp));
else
return SNMP_INTEGER(0);
- break;
case EIGRPHELLOSSENT: /* 3 */
/* Hello packets output count */
if (eigrp) {
@@ -699,7 +695,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPHELLOSRCVD: /* 4 */
/* Hello packets input count */
if (eigrp) {
@@ -711,7 +706,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPUPDATESSENT: /* 5 */
/* Update packets output count */
if (eigrp) {
@@ -723,7 +717,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPUPDATESRCVD: /* 6 */
/* Update packets input count */
if (eigrp) {
@@ -735,7 +728,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPQUERIESSENT: /* 7 */
/* Querry packets output count */
if (eigrp) {
@@ -747,7 +739,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPQUERIESRCVD: /* 8 */
/* Querry packets input count */
if (eigrp) {
@@ -759,7 +750,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPREPLIESSENT: /* 9 */
/* Reply packets output count */
if (eigrp) {
@@ -771,7 +761,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPREPLIESRCVD: /* 10 */
/* Reply packets input count */
if (eigrp) {
@@ -783,7 +772,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPACKSSENT: /* 11 */
/* Acknowledgement packets output count */
if (eigrp) {
@@ -795,7 +783,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPACKSRCVD: /* 12 */
/* Acknowledgement packets input count */
if (eigrp) {
@@ -807,21 +794,18 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPINPUTQHIGHMARK: /* 13 */
/* The highest number of EIGRP packets in the input queue */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPINPUTQDROPS: /* 14 */
/* The number of EIGRP packets dropped from the input queue */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPSIAQUERIESSENT: /* 15 */
/* SIA querry packets output count */
if (eigrp) {
@@ -833,7 +817,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPSIAQUERIESRCVD: /* 16 */
/* SIA querry packets input count */
if (eigrp) {
@@ -845,7 +828,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(counter);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPASROUTERIDTYPE: /* 17 */
/* Whether the router ID is set manually or automatically */
if (eigrp)
@@ -855,7 +837,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
else
return SNMP_INTEGER(0);
- break;
case EIGRPASROUTERID: /* 18 */
/* Router ID for this EIGRP AS */
if (eigrp)
@@ -865,7 +846,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(eigrp->router_id);
else
return SNMP_INTEGER(0);
- break;
case EIGRPTOPOROUTES: /* 19 */
/* The total number of EIGRP derived routes currently existing
in the topology table for the AS */
@@ -873,7 +853,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPHEADSERIAL: /* 20 */
/* The serial number of the first route in the internal
sequence for an AS*/
@@ -881,7 +860,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPNEXTSERIAL: /* 21 */
/* The serial number that would be assigned to the next new
or changed route in the topology table for the AS*/
@@ -889,7 +867,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPXMITPENDREPLIES: /* 22 */
/* Total number of outstanding replies expected to queries
that have been sent to peers in the current AS*/
@@ -897,7 +874,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPXMITDUMMIES: /* 23 */
/* Total number of currently existing dummies associated with
* the AS*/
@@ -905,7 +881,6 @@ static uint8_t *eigrpTraffStatsEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
default:
return NULL;
}
@@ -934,7 +909,6 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPDESTNET: /* 2 */
/* The destination IP network number for a single route in the
* topology table*/
@@ -942,7 +916,6 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPDESTNETPREFIXLEN: /* 4 */
/* The prefix length associated with the destination IP network
address
@@ -951,7 +924,6 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPACTIVE: /* 5 */
/* A value of true(1) indicates the route to the destination
network has failed
@@ -961,7 +933,6 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPSTUCKINACTIVE: /* 6 */
/* A value of true(1) indicates that that this route which is in
active state
@@ -971,14 +942,12 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPDESTSUCCESSORS: /* 7 */
/* Next routing hop for a path to the destination IP network */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPFDISTANCE: /* 8 */
/* Minimum distance from this router to the destination IP
* network */
@@ -986,7 +955,6 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPROUTEORIGINTYPE: /* 9 */
/* Text string describing the internal origin of the EIGRP route
*/
@@ -994,7 +962,6 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPROUTEORIGINADDRTYPE: /* 10 */
/* The format of the IP address defined as the origin of this
topology route entry */
@@ -1002,7 +969,6 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPROUTEORIGINADDR: /* 11 */
/* If the origin of the topology route entry is external to this
router,
@@ -1012,21 +978,18 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPNEXTHOPADDRESSTYPE: /* 12 */
/* The format of the next hop IP address */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPNEXTHOPADDRESS: /* 13 */
/* Next hop IP address for the route */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPNEXTHOPINTERFACE: /* 14 */
/* The interface through which the next hop IP address is
* reached */
@@ -1034,7 +997,6 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPDISTANCE: /* 15 */
/* The computed distance to the destination network entry from
* this router */
@@ -1042,7 +1004,6 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPREPORTDISTANCE: /* 16 */
/* The computed distance to the destination network in the
topology entry
@@ -1051,7 +1012,6 @@ static uint8_t *eigrpTopologyEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
default:
return NULL;
}
@@ -1093,7 +1053,6 @@ static uint8_t *eigrpPeerEntry(struct variable *v, oid *name, size_t *length,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPPEERADDRTYPE: /* 2 */
/* The format of the remote source IP address used by the peer
*/
@@ -1101,21 +1060,18 @@ static uint8_t *eigrpPeerEntry(struct variable *v, oid *name, size_t *length,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPPEERADDR: /* 3 */
/* The source IP address used by the peer */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPPEERIFINDEX: /* 4 */
/* The ifIndex of the interface on this router */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPHOLDTIME: /* 5 */
/* How much time must pass without receiving a hello packet from
this
@@ -1124,7 +1080,6 @@ static uint8_t *eigrpPeerEntry(struct variable *v, oid *name, size_t *length,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPUPTIME: /* 6 */
/* The elapsed time since the EIGRP adjacency was first
* established */
@@ -1132,7 +1087,6 @@ static uint8_t *eigrpPeerEntry(struct variable *v, oid *name, size_t *length,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPSRTT: /* 7 */
/* The computed smooth round trip time for packets to and from
* the peer */
@@ -1140,42 +1094,36 @@ static uint8_t *eigrpPeerEntry(struct variable *v, oid *name, size_t *length,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPRTO: /* 8 */
/* The computed retransmission timeout for the peer */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPPKTSENQUEUED: /* 9 */
/* The number of any EIGRP packets currently enqueued */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPLASTSEQ: /* 10 */
/* sequence number of the last EIGRP packet sent to this peer */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPVERSION: /* 11 */
/* The EIGRP version information reported by the remote peer */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPRETRANS: /* 12 */
/* The cumulative number of retransmissions to this peer */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPRETRIES: /* 13 */
/* The number of times the current unacknowledged packet has
* been retried */
@@ -1183,7 +1131,6 @@ static uint8_t *eigrpPeerEntry(struct variable *v, oid *name, size_t *length,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
default:
return NULL;
}
@@ -1215,7 +1162,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(eigrp_neighbor_count(eigrp));
} else
return SNMP_INTEGER(0);
- break;
case EIGRPXMITRELIABLEQ: /* 4 */
/* The number of EIGRP packets currently waiting in the reliable
transport transmission queue */
@@ -1223,7 +1169,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPXMITUNRELIABLEQ: /* 5 */
/* The number of EIGRP packets currently waiting in the
unreliable
@@ -1232,7 +1177,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPMEANSRTT: /* 6 */
/* The average of all the computed smooth round trip time values
for a packet to and from all peers established on this
@@ -1241,7 +1185,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPPACINGRELIABLE: /* 7 */
/* The configured time interval between EIGRP packet
* transmissions */
@@ -1249,7 +1192,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPPACINGUNRELIABLE: /* 8 */
/* The configured time interval between EIGRP packet
transmissions
@@ -1259,14 +1201,12 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPMFLOWTIMER: /* 9 */
/* The configured multicast flow control timer value */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPPENDINGROUTES: /* 10 */
/* The number of queued EIGRP routing updates awaiting
* transmission */
@@ -1274,7 +1214,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPHELLOINTERVAL: /* 11 */
/* The configured time interval between Hello packet
* transmissions */
@@ -1282,7 +1221,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPXMITNEXTSERIAL: /* 12 */
/* The serial number of the next EIGRP packet that is to be
queued
@@ -1291,7 +1229,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPUMCASTS: /* 13 */
/* The total number of unreliable EIGRP multicast packets sent
on this interface */
@@ -1299,7 +1236,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPRMCASTS: /* 14 */
/* The total number of reliable EIGRP multicast packets sent
on this interface */
@@ -1307,7 +1243,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPUUCASTS: /* 15 */
/* The total number of unreliable EIGRP unicast packets sent
on this interface */
@@ -1315,7 +1250,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPRUCASTS: /* 16 */
/* The total number of reliable EIGRP unicast packets sent
on this interface */
@@ -1323,7 +1257,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPMCASTEXCEPTS: /* 17 */
/* The total number of EIGRP multicast exception transmissions
*/
@@ -1331,7 +1264,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPCRPKTS: /* 18 */
/* The total number EIGRP Conditional-Receive packets sent on
* this interface */
@@ -1339,7 +1271,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPACKSSUPPRESSED: /* 19 */
/* The total number of individual EIGRP acknowledgement packets
that have been
@@ -1349,7 +1280,6 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPRETRANSSENT: /* 20 */
/* The total number EIGRP packet retransmissions sent on the
* interface */
@@ -1357,21 +1287,18 @@ static uint8_t *eigrpInterfaceEntry(struct variable *v, oid *name,
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPOOSRCVD: /* 21 */
/* The total number of out-of-sequence EIGRP packets received */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPAUTHMODE: /* 22 */
/* The EIGRP authentication mode of the interface */
if (eigrp) {
return SNMP_INTEGER(1);
} else
return SNMP_INTEGER(0);
- break;
case EIGRPAUTHKEYCHAIN: /* 23 */
/* The name of the authentication key-chain configured
on this interface. */
diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c
index a28220eb2..30b9f8861 100644
--- a/isisd/isis_spf.c
+++ b/isisd/isis_spf.c
@@ -127,34 +127,24 @@ static const char *vtype2string(enum vertextype vtype)
switch (vtype) {
case VTYPE_PSEUDO_IS:
return "pseudo_IS";
- break;
case VTYPE_PSEUDO_TE_IS:
return "pseudo_TE-IS";
- break;
case VTYPE_NONPSEUDO_IS:
return "IS";
- break;
case VTYPE_NONPSEUDO_TE_IS:
return "TE-IS";
- break;
case VTYPE_ES:
return "ES";
- break;
case VTYPE_IPREACH_INTERNAL:
return "IP internal";
- break;
case VTYPE_IPREACH_EXTERNAL:
return "IP external";
- break;
case VTYPE_IPREACH_TE:
return "IP TE";
- break;
case VTYPE_IP6REACH_INTERNAL:
return "IP6 internal";
- break;
case VTYPE_IP6REACH_EXTERNAL:
return "IP6 external";
- break;
default:
return "UNKNOWN";
}
diff --git a/lib/filter.c b/lib/filter.c
index 911a8e53d..80f8cf0bd 100644
--- a/lib/filter.c
+++ b/lib/filter.c
@@ -145,16 +145,12 @@ static const char *filter_type_str(struct filter *filter)
switch (filter->type) {
case FILTER_PERMIT:
return "permit";
- break;
case FILTER_DENY:
return "deny";
- break;
case FILTER_DYNAMIC:
return "dynamic";
- break;
default:
return "";
- break;
}
}
diff --git a/lib/plist.c b/lib/plist.c
index f6ceba81e..662221bee 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -919,7 +919,6 @@ static int vty_prefix_list_install(struct vty *vty, afi_t afi, const char *name,
default:
vty_out(vty, "%% Unrecognized AFI (%d)\n", afi);
return CMD_WARNING_CONFIG_FAILED;
- break;
}
/* If prefix has bits not under the mask, adjust it to fit */
diff --git a/lib/prefix.c b/lib/prefix.c
index 199ff3267..7bfca40f9 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -839,13 +839,10 @@ int prefix_blen(const struct prefix *p)
switch (p->family) {
case AF_INET:
return IPV4_MAX_BYTELEN;
- break;
case AF_INET6:
return IPV6_MAX_BYTELEN;
- break;
case AF_ETHERNET:
return ETH_ALEN;
- break;
}
return 0;
}
diff --git a/lib/routemap.c b/lib/routemap.c
index a604c5921..0d5621d90 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -741,13 +741,10 @@ static const char *route_map_type_str(enum route_map_type type)
switch (type) {
case RMAP_PERMIT:
return "permit";
- break;
case RMAP_DENY:
return "deny";
- break;
case RMAP_ANY:
return "";
- break;
}
return "";
diff --git a/lib/sockopt.c b/lib/sockopt.c
index 3b12d16cb..d6c88c0af 100644
--- a/lib/sockopt.c
+++ b/lib/sockopt.c
@@ -537,10 +537,8 @@ ifindex_t getsockopt_ifindex(int af, struct msghdr *msgh)
switch (af) {
case AF_INET:
return (getsockopt_ipv4_ifindex(msgh));
- break;
case AF_INET6:
return (getsockopt_ipv6_ifindex(msgh));
- break;
default:
flog_err(EC_LIB_DEVELOPMENT,
"getsockopt_ifindex: unknown address family %d", af);
diff --git a/lib/sockunion.c b/lib/sockunion.c
index 8fa9a3fad..e9c418fdf 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -124,7 +124,6 @@ static const char *sockunion_log(const union sockunion *su, char *buf,
case AF_INET6:
return inet_ntop(AF_INET6, &(su->sin6.sin6_addr), buf, len);
- break;
default:
snprintf(buf, len, "af_unknown %d ", su->sa.sa_family);
diff --git a/lib/vty.c b/lib/vty.c
index cf1613385..893c215b4 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -1221,7 +1221,6 @@ static int vty_telnet_option(struct vty *vty, unsigned char *buf, int nbytes)
vty->sb_len = 0;
vty->iac_sb_in_progress = 1;
return 0;
- break;
case SE: {
if (!vty->iac_sb_in_progress)
return 0;
@@ -1261,7 +1260,6 @@ static int vty_telnet_option(struct vty *vty, unsigned char *buf, int nbytes)
}
vty->iac_sb_in_progress = 0;
return 0;
- break;
}
default:
break;
@@ -2060,7 +2058,6 @@ static int vtysh_flush(struct vty *vty)
buffer_reset(vty->obuf);
vty_close(vty);
return -1;
- break;
case BUFFER_EMPTY:
break;
}
diff --git a/lib/zclient.c b/lib/zclient.c
index d87906346..4f2ad959d 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -269,7 +269,6 @@ static int zclient_flush_data(struct thread *thread)
"%s: buffer_flush_available failed on zclient fd %d, closing",
__func__, zclient->sock);
return zclient_failed(zclient);
- break;
case BUFFER_PENDING:
zclient->t_write = NULL;
thread_add_write(zclient->master, zclient_flush_data, zclient,
@@ -293,7 +292,6 @@ int zclient_send_message(struct zclient *zclient)
"%s: buffer_write failed to zclient fd %d, closing",
__func__, zclient->sock);
return zclient_failed(zclient);
- break;
case BUFFER_EMPTY:
THREAD_OFF(zclient->t_write);
break;
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index facb6aa63..0f9a20df8 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -1603,11 +1603,9 @@ static int route_map_command_status(struct vty *vty, enum rmap_compile_rets ret)
case RMAP_RULE_MISSING:
vty_out(vty, "OSPF6 Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED;
- break;
case RMAP_COMPILE_ERROR:
vty_out(vty, "OSPF6 Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED;
- break;
case RMAP_COMPILE_SUCCESS:
break;
}
diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c
index 1ba89f3bd..27f5ef8ed 100644
--- a/ospf6d/ospf6_snmp.c
+++ b/ospf6d/ospf6_snmp.c
@@ -1017,18 +1017,14 @@ static uint8_t *ospfv3WwLsdbEntry(struct variable *v, oid *name, size_t *length,
switch (v->magic & OSPFv3WWCOLUMN) {
case OSPFv3WWLSDBSEQUENCE:
return SNMP_INTEGER(ntohl(lsa->header->seqnum));
- break;
case OSPFv3WWLSDBAGE:
ospf6_lsa_age_current(lsa);
return SNMP_INTEGER(ntohs(lsa->header->age));
- break;
case OSPFv3WWLSDBCHECKSUM:
return SNMP_INTEGER(ntohs(lsa->header->checksum));
- break;
case OSPFv3WWLSDBADVERTISEMENT:
*var_len = ntohs(lsa->header->length);
return (uint8_t *)lsa->header;
- break;
case OSPFv3WWLSDBTYPEKNOWN:
return SNMP_INTEGER(OSPF6_LSA_IS_KNOWN(lsa->header->type)
? SNMP_TRUE
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 1b47fde21..213db15fa 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -3214,7 +3214,6 @@ int ospf_read(struct thread *thread)
switch (ret) {
case OSPF_READ_ERROR:
return -1;
- break;
case OSPF_READ_CONTINUE:
break;
}
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index da3bc6f58..7bd586fd3 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -548,54 +548,45 @@ static uint8_t *ospfGeneralGroup(struct variable *v, oid *name, size_t *length,
return SNMP_IPADDRESS(ospf->router_id);
else
return SNMP_IPADDRESS(ospf_empty_addr);
- break;
case OSPFADMINSTAT: /* 2 */
/* The administrative status of OSPF in the router. */
if (ospf_admin_stat(ospf))
return SNMP_INTEGER(OSPF_STATUS_ENABLED);
else
return SNMP_INTEGER(OSPF_STATUS_DISABLED);
- break;
case OSPFVERSIONNUMBER: /* 3 */
/* OSPF version 2. */
return SNMP_INTEGER(OSPF_VERSION);
- break;
case OSPFAREABDRRTRSTATUS: /* 4 */
/* Area Border router status. */
if (ospf && CHECK_FLAG(ospf->flags, OSPF_FLAG_ABR))
return SNMP_INTEGER(SNMP_TRUE);
else
return SNMP_INTEGER(SNMP_FALSE);
- break;
case OSPFASBDRRTRSTATUS: /* 5 */
/* AS Border router status. */
if (ospf && CHECK_FLAG(ospf->flags, OSPF_FLAG_ASBR))
return SNMP_INTEGER(SNMP_TRUE);
else
return SNMP_INTEGER(SNMP_FALSE);
- break;
case OSPFEXTERNLSACOUNT: /* 6 */
/* External LSA counts. */
if (ospf)
return SNMP_INTEGER(ospf_lsdb_count_all(ospf->lsdb));
else
return SNMP_INTEGER(0);
- break;
case OSPFEXTERNLSACKSUMSUM: /* 7 */
/* External LSA checksum. */
return SNMP_INTEGER(0);
- break;
case OSPFTOSSUPPORT: /* 8 */
/* TOS is not supported. */
return SNMP_INTEGER(SNMP_FALSE);
- break;
case OSPFORIGINATENEWLSAS: /* 9 */
/* The number of new link-state advertisements. */
if (ospf)
return SNMP_INTEGER(ospf->lsa_originate_count);
else
return SNMP_INTEGER(0);
- break;
case OSPFRXNEWLSAS: /* 10 */
/* The number of link-state advertisements received determined
to be new instantiations. */
@@ -603,24 +594,19 @@ static uint8_t *ospfGeneralGroup(struct variable *v, oid *name, size_t *length,
return SNMP_INTEGER(ospf->rx_lsa_count);
else
return SNMP_INTEGER(0);
- break;
case OSPFEXTLSDBLIMIT: /* 11 */
/* There is no limit for the number of non-default
AS-external-LSAs. */
return SNMP_INTEGER(-1);
- break;
case OSPFMULTICASTEXTENSIONS: /* 12 */
/* Multicast Extensions to OSPF is not supported. */
return SNMP_INTEGER(0);
- break;
case OSPFEXITOVERFLOWINTERVAL: /* 13 */
/* Overflow is not supported. */
return SNMP_INTEGER(0);
- break;
case OSPFDEMANDEXTENSIONS: /* 14 */
/* Demand routing is not supported. */
return SNMP_INTEGER(SNMP_FALSE);
- break;
default:
return NULL;
}
@@ -717,28 +703,20 @@ static uint8_t *ospfAreaEntry(struct variable *v, oid *name, size_t *length,
switch (v->magic) {
case OSPFAREAID: /* 1 */
return SNMP_IPADDRESS(area->area_id);
- break;
case OSPFAUTHTYPE: /* 2 */
return SNMP_INTEGER(area->auth_type);
- break;
case OSPFIMPORTASEXTERN: /* 3 */
return SNMP_INTEGER(area->external_routing + 1);
- break;
case OSPFSPFRUNS: /* 4 */
return SNMP_INTEGER(area->spf_calculation);
- break;
case OSPFAREABDRRTRCOUNT: /* 5 */
return SNMP_INTEGER(area->abr_count);
- break;
case OSPFASBDRRTRCOUNT: /* 6 */
return SNMP_INTEGER(area->asbr_count);
- break;
case OSPFAREALSACOUNT: /* 7 */
return SNMP_INTEGER(area->lsdb->total);
- break;
case OSPFAREALSACKSUMSUM: /* 8 */
return SNMP_INTEGER(0);
- break;
case OSPFAREASUMMARY: /* 9 */
#define OSPF_noAreaSummary 1
#define OSPF_sendAreaSummary 2
@@ -746,13 +724,10 @@ static uint8_t *ospfAreaEntry(struct variable *v, oid *name, size_t *length,
return SNMP_INTEGER(OSPF_noAreaSummary);
else
return SNMP_INTEGER(OSPF_sendAreaSummary);
- break;
case OSPFAREASTATUS: /* 10 */
return SNMP_INTEGER(SNMP_VALID);
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -857,29 +832,23 @@ static uint8_t *ospfStubAreaEntry(struct variable *v, oid *name, size_t *length,
case OSPFSTUBAREAID: /* 1 */
/* OSPF stub area id. */
return SNMP_IPADDRESS(area->area_id);
- break;
case OSPFSTUBTOS: /* 2 */
/* TOS value is not supported. */
return SNMP_INTEGER(0);
- break;
case OSPFSTUBMETRIC: /* 3 */
/* Default cost to stub area. */
return SNMP_INTEGER(area->default_cost);
- break;
case OSPFSTUBSTATUS: /* 4 */
/* Status of the stub area. */
return SNMP_INTEGER(SNMP_VALID);
- break;
case OSPFSTUBMETRICTYPE: /* 5 */
/* OSPF Metric type. */
#define OSPF_ospfMetric 1
#define OSPF_comparableCost 2
#define OSPF_nonComparable 3
return SNMP_INTEGER(OSPF_ospfMetric);
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -1097,32 +1066,23 @@ static uint8_t *ospfLsdbEntry(struct variable *v, oid *name, size_t *length,
switch (v->magic) {
case OSPFLSDBAREAID: /* 1 */
return SNMP_IPADDRESS(lsa->area->area_id);
- break;
case OSPFLSDBTYPE: /* 2 */
return SNMP_INTEGER(lsah->type);
- break;
case OSPFLSDBLSID: /* 3 */
return SNMP_IPADDRESS(lsah->id);
- break;
case OSPFLSDBROUTERID: /* 4 */
return SNMP_IPADDRESS(lsah->adv_router);
- break;
case OSPFLSDBSEQUENCE: /* 5 */
return SNMP_INTEGER(lsah->ls_seqnum);
- break;
case OSPFLSDBAGE: /* 6 */
return SNMP_INTEGER(lsah->ls_age);
- break;
case OSPFLSDBCHECKSUM: /* 7 */
return SNMP_INTEGER(lsah->checksum);
- break;
case OSPFLSDBADVERTISEMENT: /* 8 */
*var_len = ntohs(lsah->length);
return (uint8_t *)lsah;
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -1256,24 +1216,18 @@ static uint8_t *ospfAreaRangeEntry(struct variable *v, oid *name,
switch (v->magic) {
case OSPFAREARANGEAREAID: /* 1 */
return SNMP_IPADDRESS(area_id);
- break;
case OSPFAREARANGENET: /* 2 */
return SNMP_IPADDRESS(range_net);
- break;
case OSPFAREARANGEMASK: /* 3 */
return SNMP_IPADDRESS(mask);
- break;
case OSPFAREARANGESTATUS: /* 4 */
return SNMP_INTEGER(SNMP_VALID);
- break;
case OSPFAREARANGEEFFECT: /* 5 */
#define OSPF_advertiseMatching 1
#define OSPF_doNotAdvertiseMatching 2
return SNMP_INTEGER(OSPF_advertiseMatching);
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -1359,28 +1313,22 @@ static uint8_t *ospfHostEntry(struct variable *v, oid *name, size_t *length,
switch (v->magic) {
case OSPFHOSTIPADDRESS: /* 1 */
return SNMP_IPADDRESS(nbr_nbma->addr);
- break;
case OSPFHOSTTOS: /* 2 */
return SNMP_INTEGER(0);
- break;
case OSPFHOSTMETRIC: /* 3 */
if (oi)
return SNMP_INTEGER(oi->output_cost);
else
return SNMP_INTEGER(1);
- break;
case OSPFHOSTSTATUS: /* 4 */
return SNMP_INTEGER(SNMP_VALID);
- break;
case OSPFHOSTAREAID: /* 5 */
if (oi && oi->area)
return SNMP_IPADDRESS(oi->area->area_id);
else
return SNMP_IPADDRESS(ospf_empty_addr);
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -1683,80 +1631,59 @@ static uint8_t *ospfIfEntry(struct variable *v, oid *name, size_t *length,
switch (v->magic) {
case OSPFIFIPADDRESS: /* 1 */
return SNMP_IPADDRESS(ifaddr);
- break;
case OSPFADDRESSLESSIF: /* 2 */
return SNMP_INTEGER(ifindex);
- break;
case OSPFIFAREAID: /* 3 */
if (oi->area)
return SNMP_IPADDRESS(oi->area->area_id);
else
return SNMP_IPADDRESS(ospf_empty_addr);
- break;
case OSPFIFTYPE: /* 4 */
return SNMP_INTEGER(ospf_snmp_iftype(oi->ifp));
- break;
case OSPFIFADMINSTAT: /* 5 */
if (oi)
return SNMP_INTEGER(OSPF_STATUS_ENABLED);
else
return SNMP_INTEGER(OSPF_STATUS_DISABLED);
- break;
case OSPFIFRTRPRIORITY: /* 6 */
return SNMP_INTEGER(PRIORITY(oi));
- break;
case OSPFIFTRANSITDELAY: /* 7 */
return SNMP_INTEGER(OSPF_IF_PARAM(oi, transmit_delay));
- break;
case OSPFIFRETRANSINTERVAL: /* 8 */
return SNMP_INTEGER(OSPF_IF_PARAM(oi, retransmit_interval));
- break;
case OSPFIFHELLOINTERVAL: /* 9 */
return SNMP_INTEGER(OSPF_IF_PARAM(oi, v_hello));
- break;
case OSPFIFRTRDEADINTERVAL: /* 10 */
return SNMP_INTEGER(OSPF_IF_PARAM(oi, v_wait));
- break;
case OSPFIFPOLLINTERVAL: /* 11 */
return SNMP_INTEGER(OSPF_POLL_INTERVAL_DEFAULT);
- break;
case OSPFIFSTATE: /* 12 */
return SNMP_INTEGER(ISM_SNMP(oi->state));
- break;
case OSPFIFDESIGNATEDROUTER: /* 13 */
return SNMP_IPADDRESS(DR(oi));
- break;
case OSPFIFBACKUPDESIGNATEDROUTER: /* 14 */
return SNMP_IPADDRESS(BDR(oi));
- break;
case OSPFIFEVENTS: /* 15 */
return SNMP_INTEGER(oi->state_change);
- break;
case OSPFIFAUTHKEY: /* 16 */
*var_len = 0;
return (uint8_t *)OSPF_IF_PARAM(oi, auth_simple);
- break;
case OSPFIFSTATUS: /* 17 */
return SNMP_INTEGER(SNMP_VALID);
- break;
case OSPFIFMULTICASTFORWARDING: /* 18 */
#define ospf_snmp_multiforward_blocked 1
#define ospf_snmp_multiforward_multicast 2
#define ospf_snmp_multiforward_unicast 3
return SNMP_INTEGER(ospf_snmp_multiforward_blocked);
- break;
case OSPFIFDEMAND: /* 19 */
return SNMP_INTEGER(SNMP_FALSE);
- break;
case OSPFIFAUTHTYPE: /* 20 */
if (oi->area)
return SNMP_INTEGER(oi->area->auth_type);
else
return SNMP_INTEGER(0);
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -1851,22 +1778,16 @@ static uint8_t *ospfIfMetricEntry(struct variable *v, oid *name, size_t *length,
switch (v->magic) {
case OSPFIFMETRICIPADDRESS:
return SNMP_IPADDRESS(ifaddr);
- break;
case OSPFIFMETRICADDRESSLESSIF:
return SNMP_INTEGER(ifindex);
- break;
case OSPFIFMETRICTOS:
return SNMP_INTEGER(0);
- break;
case OSPFIFMETRICVALUE:
return SNMP_INTEGER(OSPF_SNMP_METRIC_VALUE);
- break;
case OSPFIFMETRICSTATUS:
return SNMP_INTEGER(1);
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -2041,44 +1962,32 @@ static uint8_t *ospfVirtIfEntry(struct variable *v, oid *name, size_t *length,
switch (v->magic) {
case OSPFVIRTIFAREAID:
return SNMP_IPADDRESS(area_id);
- break;
case OSPFVIRTIFNEIGHBOR:
return SNMP_IPADDRESS(neighbor);
- break;
case OSPFVIRTIFTRANSITDELAY:
return SNMP_INTEGER(OSPF_IF_PARAM(oi, transmit_delay));
- break;
case OSPFVIRTIFRETRANSINTERVAL:
return SNMP_INTEGER(OSPF_IF_PARAM(oi, retransmit_interval));
- break;
case OSPFVIRTIFHELLOINTERVAL:
return SNMP_INTEGER(OSPF_IF_PARAM(oi, v_hello));
- break;
case OSPFVIRTIFRTRDEADINTERVAL:
return SNMP_INTEGER(OSPF_IF_PARAM(oi, v_wait));
- break;
case OSPFVIRTIFSTATE:
return SNMP_INTEGER(oi->state);
- break;
case OSPFVIRTIFEVENTS:
return SNMP_INTEGER(oi->state_change);
- break;
case OSPFVIRTIFAUTHKEY:
*var_len = 0;
return (uint8_t *)OSPF_IF_PARAM(oi, auth_simple);
- break;
case OSPFVIRTIFSTATUS:
return SNMP_INTEGER(SNMP_VALID);
- break;
case OSPFVIRTIFAUTHTYPE:
if (oi->area)
return SNMP_INTEGER(oi->area->auth_type);
else
return SNMP_INTEGER(0);
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -2262,40 +2171,28 @@ static uint8_t *ospfNbrEntry(struct variable *v, oid *name, size_t *length,
switch (v->magic) {
case OSPFNBRIPADDR:
return SNMP_IPADDRESS(nbr_addr);
- break;
case OSPFNBRADDRESSLESSINDEX:
return SNMP_INTEGER(ifindex);
- break;
case OSPFNBRRTRID:
return SNMP_IPADDRESS(nbr->router_id);
- break;
case OSPFNBROPTIONS:
return SNMP_INTEGER(oi->nbr_self->options);
- break;
case OSPFNBRPRIORITY:
return SNMP_INTEGER(nbr->priority);
- break;
case OSPFNBRSTATE:
return SNMP_INTEGER(ospf_snmp_neighbor_state(nbr->state));
- break;
case OSPFNBREVENTS:
return SNMP_INTEGER(nbr->state_change);
- break;
case OSPFNBRLSRETRANSQLEN:
return SNMP_INTEGER(ospf_ls_retransmit_count(nbr));
- break;
case OSPFNBMANBRSTATUS:
return SNMP_INTEGER(SNMP_VALID);
- break;
case OSPFNBMANBRPERMANENCE:
return SNMP_INTEGER(2);
- break;
case OSPFNBRHELLOSUPPRESSED:
return SNMP_INTEGER(SNMP_FALSE);
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -2329,31 +2226,22 @@ static uint8_t *ospfVirtNbrEntry(struct variable *v, oid *name, size_t *length,
switch (v->magic) {
case OSPFVIRTNBRAREA:
return (uint8_t *)NULL;
- break;
case OSPFVIRTNBRRTRID:
return (uint8_t *)NULL;
- break;
case OSPFVIRTNBRIPADDR:
return (uint8_t *)NULL;
- break;
case OSPFVIRTNBROPTIONS:
return (uint8_t *)NULL;
- break;
case OSPFVIRTNBRSTATE:
return (uint8_t *)NULL;
- break;
case OSPFVIRTNBREVENTS:
return (uint8_t *)NULL;
- break;
case OSPFVIRTNBRLSRETRANSQLEN:
return (uint8_t *)NULL;
- break;
case OSPFVIRTNBRHELLOSUPPRESSED:
return (uint8_t *)NULL;
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -2483,29 +2371,21 @@ static uint8_t *ospfExtLsdbEntry(struct variable *v, oid *name, size_t *length,
switch (v->magic) {
case OSPFEXTLSDBTYPE:
return SNMP_INTEGER(OSPF_AS_EXTERNAL_LSA);
- break;
case OSPFEXTLSDBLSID:
return SNMP_IPADDRESS(lsah->id);
- break;
case OSPFEXTLSDBROUTERID:
return SNMP_IPADDRESS(lsah->adv_router);
- break;
case OSPFEXTLSDBSEQUENCE:
return SNMP_INTEGER(lsah->ls_seqnum);
- break;
case OSPFEXTLSDBAGE:
return SNMP_INTEGER(lsah->ls_age);
- break;
case OSPFEXTLSDBCHECKSUM:
return SNMP_INTEGER(lsah->checksum);
- break;
case OSPFEXTLSDBADVERTISEMENT:
*var_len = ntohs(lsah->length);
return (uint8_t *)lsah;
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -2523,25 +2403,18 @@ static uint8_t *ospfAreaAggregateEntry(struct variable *v, oid *name,
switch (v->magic) {
case OSPFAREAAGGREGATEAREAID:
return (uint8_t *)NULL;
- break;
case OSPFAREAAGGREGATELSDBTYPE:
return (uint8_t *)NULL;
- break;
case OSPFAREAAGGREGATENET:
return (uint8_t *)NULL;
- break;
case OSPFAREAAGGREGATEMASK:
return (uint8_t *)NULL;
- break;
case OSPFAREAAGGREGATESTATUS:
return (uint8_t *)NULL;
- break;
case OSPFAREAAGGREGATEEFFECT:
return (uint8_t *)NULL;
- break;
default:
return NULL;
- break;
}
return NULL;
}
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index d9c9bb37d..22d6e6298 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -370,34 +370,28 @@ const char *pim_ifchannel_ifjoin_name(enum pim_ifjoin_state ifjoin_state,
return "SGRpt(NI)";
else
return "NOINFO";
- break;
case PIM_IFJOIN_JOIN:
return "JOIN";
- break;
case PIM_IFJOIN_PRUNE:
if (PIM_IF_FLAG_TEST_S_G_RPT(flags))
return "SGRpt(P)";
else
return "PRUNE";
- break;
case PIM_IFJOIN_PRUNE_PENDING:
if (PIM_IF_FLAG_TEST_S_G_RPT(flags))
return "SGRpt(PP)";
else
return "PRUNEP";
- break;
case PIM_IFJOIN_PRUNE_TMP:
if (PIM_IF_FLAG_TEST_S_G_RPT(flags))
return "SGRpt(P')";
else
return "PRUNET";
- break;
case PIM_IFJOIN_PRUNE_PENDING_TMP:
if (PIM_IF_FLAG_TEST_S_G_RPT(flags))
return "SGRpt(PP')";
else
return "PRUNEPT";
- break;
}
return "ifjoin_bad_state";
diff --git a/pimd/pim_macro.c b/pimd/pim_macro.c
index bdef83925..6691cc00d 100644
--- a/pimd/pim_macro.c
+++ b/pimd/pim_macro.c
@@ -45,11 +45,9 @@ static int downstream_jpstate_isjoined(const struct pim_ifchannel *ch)
case PIM_IFJOIN_PRUNE_TMP:
case PIM_IFJOIN_PRUNE_PENDING_TMP:
return 0;
- break;
case PIM_IFJOIN_JOIN:
case PIM_IFJOIN_PRUNE_PENDING:
return 1;
- break;
}
return 0;
}
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index 342c0a74e..b367aa21f 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -513,7 +513,6 @@ static int pim_msg_send_frame(int fd, char *buf, size_t len,
}
return -1;
- break;
default:
if (PIM_DEBUG_PIM_PACKETS) {
pim_inet4_dump("<dst?>", ip->ip_dst, dst_str,
@@ -524,7 +523,6 @@ static int pim_msg_send_frame(int fd, char *buf, size_t len,
errno, safe_strerror(errno));
}
return -1;
- break;
}
}
diff --git a/pimd/pim_register.c b/pimd/pim_register.c
index 013f04bb0..aa9faf692 100644
--- a/pimd/pim_register.c
+++ b/pimd/pim_register.c
@@ -141,7 +141,6 @@ int pim_register_stop_recv(struct interface *ifp, uint8_t *buf, int buf_size)
case PIM_REG_NOINFO:
case PIM_REG_PRUNE:
return 0;
- break;
case PIM_REG_JOIN:
upstream->reg_state = PIM_REG_PRUNE;
pim_channel_del_oif(upstream->channel_oil, pim->regiface,
@@ -154,7 +153,6 @@ int pim_register_stop_recv(struct interface *ifp, uint8_t *buf, int buf_size)
upstream->reg_state = PIM_REG_PRUNE;
pim_upstream_start_register_stop_timer(upstream, 0);
return 0;
- break;
}
return 0;
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 1eb5006b9..24519adb1 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -373,14 +373,11 @@ int pim_rpf_addr_is_inaddr_none(struct pim_rpf *rpf)
switch (rpf->rpf_addr.family) {
case AF_INET:
return rpf->rpf_addr.u.prefix4.s_addr == INADDR_NONE;
- break;
case AF_INET6:
zlog_warn("%s: v6 Unimplmeneted", __PRETTY_FUNCTION__);
return 1;
- break;
default:
return 0;
- break;
}
return 0;
@@ -391,14 +388,11 @@ int pim_rpf_addr_is_inaddr_any(struct pim_rpf *rpf)
switch (rpf->rpf_addr.family) {
case AF_INET:
return rpf->rpf_addr.u.prefix4.s_addr == INADDR_ANY;
- break;
case AF_INET6:
zlog_warn("%s: v6 Unimplmented", __PRETTY_FUNCTION__);
return 1;
- break;
default:
return 0;
- break;
}
return 0;
diff --git a/pimd/pim_tlv.c b/pimd/pim_tlv.c
index 93e1cc1f8..5faa49927 100644
--- a/pimd/pim_tlv.c
+++ b/pimd/pim_tlv.c
@@ -131,7 +131,6 @@ int pim_encode_addr_ucast(uint8_t *buf, struct prefix *p)
++buf;
memcpy(buf, &p->u.prefix4, sizeof(struct in_addr));
return ucast_ipv4_encoding_len;
- break;
case AF_INET6:
*(uint8_t *)buf = PIM_MSG_ADDRESS_FAMILY_IPV6;
++buf;
@@ -139,10 +138,8 @@ int pim_encode_addr_ucast(uint8_t *buf, struct prefix *p)
++buf;
memcpy(buf, &p->u.prefix6, sizeof(struct in6_addr));
return ucast_ipv6_encoding_len;
- break;
default:
return 0;
- break;
}
}
@@ -211,10 +208,8 @@ int pim_encode_addr_group(uint8_t *buf, afi_t afi, int bidir, int scope,
++buf;
memcpy(buf, &group, sizeof(struct in_addr));
return group_ipv4_encoding_len;
- break;
default:
return 0;
- break;
}
}
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index afd10bd3d..c899e403c 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -1569,10 +1569,8 @@ const char *pim_upstream_state2str(enum pim_upstream_state join_state)
switch (join_state) {
case PIM_UPSTREAM_NOTJOINED:
return "NotJoined";
- break;
case PIM_UPSTREAM_JOINED:
return "Joined";
- break;
}
return "Unknown";
}
diff --git a/ripd/rip_snmp.c b/ripd/rip_snmp.c
index 7260a40b1..39e07f3c2 100644
--- a/ripd/rip_snmp.c
+++ b/ripd/rip_snmp.c
@@ -170,13 +170,10 @@ static uint8_t *rip2Globals(struct variable *v, oid name[], size_t *length,
switch (v->magic) {
case RIP2GLOBALROUTECHANGES:
return SNMP_INTEGER(rip->counters.route_changes);
- break;
case RIP2GLOBALQUERIES:
return SNMP_INTEGER(rip->counters.queries);
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -373,7 +370,6 @@ static uint8_t *rip2IfStatEntry(struct variable *v, oid name[], size_t *length,
switch (v->magic) {
case RIP2IFSTATADDRESS:
return SNMP_IPADDRESS(addr);
- break;
case RIP2IFSTATRCVBADPACKETS:
*var_len = sizeof(long);
return (uint8_t *)&ri->recv_badpackets;
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 225524c67..92d52ff65 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1002,7 +1002,6 @@ static int vtysh_process_questionmark(const char *input, int input_len)
vty_out(vty, "%% Ambiguous command.\n");
rl_on_new_line();
return 0;
- break;
case CMD_ERR_NO_MATCH:
cmd_free_strvec(vline);
if (describe)
@@ -1010,7 +1009,6 @@ static int vtysh_process_questionmark(const char *input, int input_len)
vty_out(vty, "%% There is no matched command.\n");
rl_on_new_line();
return 0;
- break;
}
/* Get width of command string. */
diff --git a/zebra/interface.c b/zebra/interface.c
index bcb833b8d..7e7397a3b 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1231,27 +1231,21 @@ static const char *zebra_ziftype_2str(zebra_iftype_t zif_type)
switch (zif_type) {
case ZEBRA_IF_OTHER:
return "Other";
- break;
case ZEBRA_IF_BRIDGE:
return "Bridge";
- break;
case ZEBRA_IF_VLAN:
return "Vlan";
- break;
case ZEBRA_IF_VXLAN:
return "Vxlan";
- break;
case ZEBRA_IF_VRF:
return "VRF";
- break;
case ZEBRA_IF_VETH:
return "VETH";
- break;
case ZEBRA_IF_BOND:
return "bond";
@@ -1264,7 +1258,6 @@ static const char *zebra_ziftype_2str(zebra_iftype_t zif_type)
default:
return "Unknown";
- break;
}
}
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
index d6f55fdeb..be29b75ae 100644
--- a/zebra/zebra_fpm_netlink.c
+++ b/zebra/zebra_fpm_netlink.c
@@ -57,13 +57,10 @@ static inline const char *addr_to_a(uint8_t af, void *addr)
case AF_INET:
return inet_ntoa(*((struct in_addr *)addr));
- break;
case AF_INET6:
return inet6_ntoa(*((struct in6_addr *)addr));
- break;
default:
return "<Addr in unknown AF>";
- break;
}
}
@@ -92,10 +89,8 @@ static size_t af_addr_size(uint8_t af)
case AF_INET:
return 4;
- break;
case AF_INET6:
return 16;
- break;
default:
assert(0);
return 16;
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index d5d424732..c167e6a8a 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -1244,7 +1244,6 @@ static zebra_nhlfe_t *nhlfe_add(zebra_lsp_t *lsp, enum lsp_types_t lsp_type,
nexthop_free(nexthop);
XFREE(MTYPE_NHLFE, nhlfe);
return NULL;
- break;
}
nhlfe->nexthop = nexthop;
diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c
index 4c5265198..70bb6a14c 100644
--- a/zebra/zebra_snmp.c
+++ b/zebra/zebra_snmp.c
@@ -470,25 +470,20 @@ static uint8_t *ipFwTable(struct variable *v, oid objid[], size_t *objid_len,
case IPFORWARDDEST:
*val_len = 4;
return &np->p.u.prefix;
- break;
case IPFORWARDMASK:
masklen2ip(np->p.prefixlen, &netmask);
*val_len = 4;
return (uint8_t *)&netmask;
- break;
case IPFORWARDPOLICY:
result = 0;
*val_len = sizeof(int);
return (uint8_t *)&result;
- break;
case IPFORWARDNEXTHOP:
*val_len = 4;
return (uint8_t *)&nexthop->gate.ipv4;
- break;
case IPFORWARDIFINDEX:
*val_len = sizeof(int);
return (uint8_t *)&nexthop->ifindex;
- break;
case IPFORWARDTYPE:
if (nexthop->type == NEXTHOP_TYPE_IFINDEX)
result = 3;
@@ -496,56 +491,45 @@ static uint8_t *ipFwTable(struct variable *v, oid objid[], size_t *objid_len,
result = 4;
*val_len = sizeof(int);
return (uint8_t *)&result;
- break;
case IPFORWARDPROTO:
result = proto_trans(re->type);
*val_len = sizeof(int);
return (uint8_t *)&result;
- break;
case IPFORWARDAGE:
result = 0;
*val_len = sizeof(int);
return (uint8_t *)&result;
- break;
case IPFORWARDINFO:
resarr[0] = 0;
resarr[1] = 0;
*val_len = 2 * sizeof(int);
return (uint8_t *)resarr;
- break;
case IPFORWARDNEXTHOPAS:
result = -1;
*val_len = sizeof(int);
return (uint8_t *)&result;
- break;
case IPFORWARDMETRIC1:
result = 0;
*val_len = sizeof(int);
return (uint8_t *)&result;
- break;
case IPFORWARDMETRIC2:
result = 0;
*val_len = sizeof(int);
return (uint8_t *)&result;
- break;
case IPFORWARDMETRIC3:
result = 0;
*val_len = sizeof(int);
return (uint8_t *)&result;
- break;
case IPFORWARDMETRIC4:
result = 0;
*val_len = sizeof(int);
return (uint8_t *)&result;
- break;
case IPFORWARDMETRIC5:
result = 0;
*val_len = sizeof(int);
return (uint8_t *)&result;
- break;
default:
return NULL;
- break;
}
return NULL;
}
@@ -563,7 +547,6 @@ static uint8_t *ipCidrTable(struct variable *v, oid objid[], size_t *objid_len,
break;
default:
return NULL;
- break;
}
return NULL;
}