diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2023-10-11 00:15:32 +0300 | 
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2023-10-12 21:23:18 +0300 | 
| commit | 7d67b9ff28d09de58c632f80ef7d330e45e698f6 (patch) | |
| tree | 16c8afc9dc80d70951f83d2f1182ace0edc7ee49 /ospf6d | |
| parent | 9bc4d9eaec92589deda092bd867054e25e64be3f (diff) | |
build: add -Wimplicit-fallthrough
Also:
- replace all /* fallthrough */ comments with portable fallthrough;
pseudo keyword to accomodate both gcc and clang
- add missing break; statements as required by older versions of gcc
- cleanup some code to remove unnecessary fallthrough
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ospf6d')
| -rw-r--r-- | ospf6d/ospf6_message.c | 12 | ||||
| -rw-r--r-- | ospf6d/ospf6_route.c | 2 | ||||
| -rw-r--r-- | ospf6d/ospf6_route.h | 2 | ||||
| -rw-r--r-- | ospf6d/ospf6_snmp.c | 4 | 
4 files changed, 10 insertions, 10 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index 07da9a5ec1..7fbe08d30f 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -631,8 +631,8 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,  					"Neighbor state is not ExStart, ignore");  			return;  		} -	/* else fall through to ExStart */ -	/* fallthru */ +		/* else fall through to ExStart */ +		fallthrough;  	case OSPF6_NEIGHBOR_EXSTART:  		/* if neighbor obeys us as our slave, schedule negotiation_done  		   and process LSA Headers. Otherwise, ignore this message */ @@ -650,8 +650,8 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,  				  on->ospf6_if->interface->vrf->name, on->name);  			return;  		} -	/* fall through to exchange */ - +		/* fall through to exchange */ +		fallthrough;  	case OSPF6_NEIGHBOR_EXCHANGE:  		if (!memcmp(dbdesc, &on->dbdesc_last,  			    sizeof(struct ospf6_dbdesc))) { @@ -835,8 +835,8 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,  					"Neighbor state is not ExStart, ignore");  			return;  		} -	/* else fall through to ExStart */ -	/* fallthru */ +		/* else fall through to ExStart */ +		fallthrough;  	case OSPF6_NEIGHBOR_EXSTART:  		/* If the neighbor is Master, act as Slave. Schedule  		   negotiation_done diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 443032933d..ca026dc97f 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -363,7 +363,7 @@ void ospf6_route_zebra_copy_nexthops(struct ospf6_route *route,  			case NEXTHOP_TYPE_IPV6_IFINDEX:  				nexthops[i].ifindex = nh->ifindex; -				/* FALLTHROUGH */ +				fallthrough;  			case NEXTHOP_TYPE_IPV6:  				nexthops[i].gate.ipv6 = nh->address;  				break; diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h index c2125951ec..2c1d17efc3 100644 --- a/ospf6d/ospf6_route.h +++ b/ospf6d/ospf6_route.h @@ -67,7 +67,7 @@ static inline bool ospf6_nexthop_is_same(const struct ospf6_nexthop *nha,  	case NEXTHOP_TYPE_IPV6_IFINDEX:  		if (nha->ifindex != nhb->ifindex)  			return false; -		/* FALLTHROUGH */ +		fallthrough;  	case NEXTHOP_TYPE_IPV6:  		if (!IN6_ARE_ADDR_EQUAL(&nha->address, &nhb->address))  			return false; diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c index f88667bfd0..671291312a 100644 --- a/ospf6d/ospf6_snmp.c +++ b/ospf6d/ospf6_snmp.c @@ -697,8 +697,8 @@ static uint8_t *ospfv3GeneralGroup(struct variable *v, oid *name,  	case OSPFv3REFERENCEBANDWIDTH:  		if (ospf6)  			return SNMP_INTEGER(ospf6->ref_bandwidth); -	/* Otherwise, like for "not implemented". */ -	/* fallthru */ +		/* Otherwise, like for "not implemented". */ +		return NULL;  	case OSPFv3RESTARTSUPPORT:  	case OSPFv3RESTARTINTERVAL:  	case OSPFv3RESTARTSTRICTLSACHECKING:  | 
