diff options
Diffstat (limited to 'lib/prefix.c')
| -rw-r--r-- | lib/prefix.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/lib/prefix.c b/lib/prefix.c index 1d098f78c5..655e28c9f0 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -1,22 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Prefix related functions. * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro - * - * This file is part of GNU Zebra. - * - * GNU Zebra is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * GNU Zebra is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; see the file COPYING; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <zebra.h> @@ -148,11 +133,11 @@ const char *afi2str(afi_t afi) case AFI_L2VPN: return "l2vpn"; case AFI_MAX: + case AFI_UNSPEC: return "bad-value"; - default: - break; } - return NULL; + + assert(!"Reached end of function we should never reach"); } const char *safi2str(safi_t safi) @@ -172,9 +157,12 @@ const char *safi2str(safi_t safi) return "labeled-unicast"; case SAFI_FLOWSPEC: return "flowspec"; - default: + case SAFI_UNSPEC: + case SAFI_MAX: return "unknown"; } + + assert(!"Reached end of function we should never reach"); } /* If n includes p prefix then return 1 else return 0. */ @@ -1507,7 +1495,7 @@ static ssize_t printfrr_ia(struct fbuf *buf, struct printfrr_eargs *ea, return bputch(buf, '*'); break; - default: + case IPADDR_NONE: break; } } |
