summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorpaul <paul>2006-01-19 20:16:55 +0000
committerpaul <paul>2006-01-19 20:16:55 +0000
commite8e1946edf6ba87ef53832cdceccc39d7f0c3f26 (patch)
treefcdaf92bf4129a8a58825bd21ae841a6b3b2bda8 /bgpd
parent779adb0147cfff1a831b08853976342ad2110fcd (diff)
[compiler] miscellaneous trivial compiler warning fixes
2006-01-19 Paul Jakma <paul.jakma@sun.com> * (general) various miscellaneous compiler warning fixes. Remove redundant break statements from switch clauses which return. return from main, not exit, cause it annoys SOS. Remove stray semi-colons which cause empty-statement warnings. * zebra/main.c: (sighup) remove private declaration of external function.
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/ChangeLog9
-rw-r--r--bgpd/bgp_aspath.c8
-rw-r--r--bgpd/bgp_attr.c1
-rw-r--r--bgpd/bgp_clist.c1
-rw-r--r--bgpd/bgp_community.c1
-rw-r--r--bgpd/bgp_ecommunity.c1
-rw-r--r--bgpd/bgp_filter.c3
-rw-r--r--bgpd/bgp_main.c2
-rw-r--r--bgpd/bgp_packet.c1
-rw-r--r--bgpd/bgp_route.c2
-rw-r--r--bgpd/bgp_routemap.c8
-rw-r--r--bgpd/bgp_vty.c16
-rw-r--r--bgpd/bgpd.c2
13 files changed, 15 insertions, 40 deletions
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 234ecb5d..c96bc649 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,3 +1,12 @@
+2006-01-19 Paul Jakma <paul.jakma@sun.com>
+
+ * (general) various miscellaneous compiler warning fixes.
+ Remove redundant break statements from switch clauses
+ which return.
+ return from main, not exit, cause it annoys SOS.
+ Remove stray semi-colons which cause empty-statement
+ warnings.
+
2006-01-17 Paul Jakma <paul.jakma@sun.com>
* bgp_nexthop.c: (zlookup_read*) convert to new Zserv format.
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index e9a6d6a2..2cc5ed35 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -1309,37 +1309,30 @@ aspath_gettoken (const char *buf, enum as_token *token, u_short *asno)
{
case '\0':
return NULL;
- break;
case '{':
*token = as_token_set_start;
p++;
return p;
- break;
case '}':
*token = as_token_set_end;
p++;
return p;
- break;
case '(':
*token = as_token_confed_seq_start;
p++;
return p;
- break;
case ')':
*token = as_token_confed_seq_end;
p++;
return p;
- break;
case '[':
*token = as_token_confed_set_start;
p++;
return p;
- break;
case ']':
*token = as_token_confed_set_end;
p++;
return p;
- break;
}
/* Check actual AS value. */
@@ -1423,7 +1416,6 @@ aspath_str2aspath (const char *str)
default:
aspath_free (aspath);
return NULL;
- break;
}
}
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 4b94b11e..3b27517d 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -983,7 +983,6 @@ bgp_mp_reach_parse (struct peer *peer, bgp_size_t length, struct attr *attr,
zlog_info ("Wrong multiprotocol next hop length: %d",
attr->mp_nexthop_len);
return -1;
- break;
}
snpa_num = stream_getc (s);
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c
index e5b4344e..f75fc55b 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -41,7 +41,6 @@ community_list_master_lookup (struct community_list_handler *ch, int master)
{
case COMMUNITY_LIST_MASTER:
return &ch->community_list;
- break;
case EXTCOMMUNITY_LIST_MASTER:
return &ch->extcommunity_list;
}
diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c
index 35e644b1..3033db14 100644
--- a/bgpd/bgp_community.c
+++ b/bgpd/bgp_community.c
@@ -594,7 +594,6 @@ community_str2com (const char *str)
default:
if (com)
community_free (com);
- return NULL;
break;
}
}
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c
index bcd37ea6..64f4438f 100644
--- a/bgpd/bgp_ecommunity.c
+++ b/bgpd/bgp_ecommunity.c
@@ -500,7 +500,6 @@ ecommunity_str2com (const char *str, int type, int keyword_included)
if (ecom)
ecommunity_free (ecom);
return NULL;
- break;
}
}
return ecom;
diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c
index de572c0a..ab7f0703 100644
--- a/bgpd/bgp_filter.c
+++ b/bgpd/bgp_filter.c
@@ -303,13 +303,10 @@ filter_type_str (enum as_filter_type type)
{
case AS_FILTER_PERMIT:
return "permit";
- break;
case AS_FILTER_DENY:
return "deny";
- break;
default:
return "";
- break;
}
}
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c
index f9f0373d..0baae3bf 100644
--- a/bgpd/bgp_main.c
+++ b/bgpd/bgp_main.c
@@ -313,5 +313,5 @@ main (int argc, char **argv)
thread_call (&thread);
/* Not reached. */
- exit (0);
+ return (0);
}
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index fa218e29..07c3cbb1 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -678,7 +678,6 @@ bgp_write (struct thread *thread)
peer->status = Idle;
bgp_timer_set (peer);
return 0;
- break;
case BGP_MSG_KEEPALIVE:
peer->keepalive_out++;
break;
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index f2621c1f..e0d2a317 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -8100,7 +8100,7 @@ ALIAS (show_bgp_community_list,
"Address family\n"
"Display routes matching the community-list\n"
"community-list number\n"
- "community-list name\n");
+ "community-list name\n")
/* old command */
DEFUN (show_ipv6_bgp_community_list,
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index bc9b6f78..15ba9452 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -2046,11 +2046,9 @@ bgp_route_match_add (struct vty *vty, struct route_map_index *index,
case RMAP_RULE_MISSING:
vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
case RMAP_COMPILE_ERROR:
vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
}
}
return CMD_SUCCESS;
@@ -2071,11 +2069,9 @@ bgp_route_match_delete (struct vty *vty, struct route_map_index *index,
case RMAP_RULE_MISSING:
vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
case RMAP_COMPILE_ERROR:
vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
}
}
return CMD_SUCCESS;
@@ -2096,11 +2092,9 @@ bgp_route_set_add (struct vty *vty, struct route_map_index *index,
case RMAP_RULE_MISSING:
vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
case RMAP_COMPILE_ERROR:
vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
}
}
return CMD_SUCCESS;
@@ -2121,11 +2115,9 @@ bgp_route_set_delete (struct vty *vty, struct route_map_index *index,
case RMAP_RULE_MISSING:
vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
case RMAP_COMPILE_ERROR:
vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
}
}
return CMD_SUCCESS;
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index c8d5b2ac..6ee48236 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -324,17 +324,14 @@ DEFUN (router_bgp,
vty_out (vty, "Please specify 'bgp multiple-instance' first%s",
VTY_NEWLINE);
return CMD_WARNING;
- break;
case BGP_ERR_AS_MISMATCH:
vty_out (vty, "BGP is already running; AS is %d%s", as, VTY_NEWLINE);
return CMD_WARNING;
- break;
case BGP_ERR_INSTANCE_MISMATCH:
vty_out (vty, "BGP view name and AS number mismatch%s", VTY_NEWLINE);
vty_out (vty, "BGP instance is already running; AS is %d%s",
as, VTY_NEWLINE);
return CMD_WARNING;
- break;
}
vty->node = BGP_NODE;
@@ -1276,11 +1273,9 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str,
case BGP_ERR_PEER_GROUP_MEMBER:
vty_out (vty, "%% Peer-group AS %d. Cannot configure remote-as for member%s", as, VTY_NEWLINE);
return CMD_WARNING;
- break;
case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT:
vty_out (vty, "%% The AS# can not be changed from %d to %s, peer-group members must be all internal or all external%s", as, as_str, VTY_NEWLINE);
return CMD_WARNING;
- break;
}
return bgp_vty_return (vty, ret);
}
@@ -2671,7 +2666,7 @@ ALIAS (neighbor_disable_connected_check,
NEIGHBOR_CMD2 "enforce-multihop",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "Enforce EBGP neighbors perform multihop\n");
+ "Enforce EBGP neighbors perform multihop\n")
/* Enforce multihop. */
ALIAS (no_neighbor_disable_connected_check,
@@ -2680,7 +2675,7 @@ ALIAS (no_neighbor_disable_connected_check,
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "Enforce EBGP neighbors perform multihop\n");
+ "Enforce EBGP neighbors perform multihop\n")
DEFUN (neighbor_description,
neighbor_description_cmd,
@@ -3804,7 +3799,7 @@ ALIAS (no_neighbor_maximum_prefix,
NEIGHBOR_ADDR_STR2
"Maximum number of prefix accept from this peer\n"
"maximum no. of prefix limit\n"
- "Only give warning message when limit is exceeded\n");
+ "Only give warning message when limit is exceeded\n")
ALIAS (no_neighbor_maximum_prefix,
no_neighbor_maximum_prefix_threshold_warning_cmd,
@@ -3815,7 +3810,7 @@ ALIAS (no_neighbor_maximum_prefix,
"Maximum number of prefix accept from this peer\n"
"maximum no. of prefix limit\n"
"Threshold value (%) at which to generate a warning msg\n"
- "Only give warning message when limit is exceeded\n");
+ "Only give warning message when limit is exceeded\n")
ALIAS (no_neighbor_maximum_prefix,
no_neighbor_maximum_prefix_restart_cmd,
@@ -9646,13 +9641,10 @@ community_direct_str (int direct)
{
case COMMUNITY_DENY:
return "deny";
- break;
case COMMUNITY_PERMIT:
return "permit";
- break;
default:
return "unknown";
- break;
}
}
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index ea365dec..1f1b4fd2 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -85,7 +85,6 @@ bgp_option_set (int flag)
break;
default:
return BGP_ERR_INVALID_FLAG;
- break;
}
return 0;
}
@@ -105,7 +104,6 @@ bgp_option_unset (int flag)
break;
default:
return BGP_ERR_INVALID_FLAG;
- break;
}
return 0;
}