diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-02-22 19:04:25 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-02-23 19:56:04 -0500 | 
| commit | cc9f21da2218d95567eff1501482ce58e6600f54 (patch) | |
| tree | d579c9754161d874bad6eb09c67821b65fb559ca /ripngd | |
| parent | eaba619fc183f68a456b3918f449185b3b477426 (diff) | |
*: Change thread->func to return void instead of int
The int return value is never used.  Modify the code
base to just return a void instead.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ripngd')
| -rw-r--r-- | ripngd/ripng_interface.c | 6 | ||||
| -rw-r--r-- | ripngd/ripng_peer.c | 4 | ||||
| -rw-r--r-- | ripngd/ripngd.c | 32 | 
3 files changed, 14 insertions, 28 deletions
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index a6d379fda4..57bc40f005 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -601,7 +601,7 @@ int ripng_enable_if_delete(struct ripng *ripng, const char *ifname)  }  /* Wake up interface. */ -static int ripng_interface_wakeup(struct thread *t) +static void ripng_interface_wakeup(struct thread *t)  {  	struct interface *ifp;  	struct ripng_interface *ri; @@ -616,7 +616,7 @@ static int ripng_interface_wakeup(struct thread *t)  		flog_err_sys(EC_LIB_SOCKET,  			     "multicast join failed, interface %s not running",  			     ifp->name); -		return 0; +		return;  	}  	/* Set running flag. */ @@ -624,8 +624,6 @@ static int ripng_interface_wakeup(struct thread *t)  	/* Send RIP request to the interface. */  	ripng_request(ifp); - -	return 0;  }  static void ripng_connect_set(struct interface *ifp, int set) diff --git a/ripngd/ripng_peer.c b/ripngd/ripng_peer.c index 554b1d68f6..010fdda89e 100644 --- a/ripngd/ripng_peer.c +++ b/ripngd/ripng_peer.c @@ -75,15 +75,13 @@ struct ripng_peer *ripng_peer_lookup_next(struct ripng *ripng,  /* RIPng peer is timeout.   * Garbage collector.   **/ -static int ripng_peer_timeout(struct thread *t) +static void ripng_peer_timeout(struct thread *t)  {  	struct ripng_peer *peer;  	peer = THREAD_ARG(t);  	listnode_delete(peer->ripng->peer_list, peer);  	ripng_peer_free(peer); - -	return 0;  }  /* Get RIPng peer.  At the same time update timeout thread. */ diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 27cffd4321..e103cdc3a8 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -61,7 +61,7 @@ void ripng_output_process(struct interface *, struct sockaddr_in6 *, int);  static void ripng_instance_enable(struct ripng *ripng, struct vrf *vrf,  				  int sock);  static void ripng_instance_disable(struct ripng *ripng); -int ripng_triggered_update(struct thread *); +static void ripng_triggered_update(struct thread *);  static void ripng_if_rmap_update(struct if_rmap_ctx *ctx,  				 struct if_rmap *if_rmap); @@ -423,7 +423,7 @@ static int ripng_lladdr_check(struct interface *ifp, struct in6_addr *addr)  }  /* RIPng route garbage collect timer. */ -static int ripng_garbage_collect(struct thread *t) +static void ripng_garbage_collect(struct thread *t)  {  	struct ripng_info *rinfo;  	struct agg_node *rp; @@ -445,8 +445,6 @@ static int ripng_garbage_collect(struct thread *t)  	/* Free RIPng routing information. */  	ripng_info_free(rinfo); - -	return 0;  }  static void ripng_timeout_update(struct ripng *ripng, struct ripng_info *rinfo); @@ -602,14 +600,12 @@ struct ripng_info *ripng_ecmp_delete(struct ripng *ripng,  }  /* Timeout RIPng routes. */ -static int ripng_timeout(struct thread *t) +static void ripng_timeout(struct thread *t)  {  	struct ripng_info *rinfo = THREAD_ARG(t);  	struct ripng *ripng = ripng_info_get_instance(rinfo);  	ripng_ecmp_delete(ripng, rinfo); - -	return 0;  }  static void ripng_timeout_update(struct ripng *ripng, struct ripng_info *rinfo) @@ -1301,7 +1297,7 @@ static void ripng_request_process(struct ripng_packet *packet, int size,  }  /* First entry point of reading RIPng packet. */ -static int ripng_read(struct thread *thread) +static void ripng_read(struct thread *thread)  {  	struct ripng *ripng = THREAD_ARG(thread);  	int len; @@ -1330,7 +1326,7 @@ static int ripng_read(struct thread *thread)  	if (len < 0) {  		zlog_warn("RIPng recvfrom failed (VRF %s): %s.",  			  ripng->vrf_name, safe_strerror(errno)); -		return len; +		return;  	}  	/* Check RTE boundary.  RTE size (Packet length - RIPng header size @@ -1339,7 +1335,7 @@ static int ripng_read(struct thread *thread)  		zlog_warn("RIPng invalid packet size %d from %pI6 (VRF %s)",  			  len, &from.sin6_addr, ripng->vrf_name);  		ripng_peer_bad_packet(ripng, &from); -		return 0; +		return;  	}  	packet = (struct ripng_packet *)STREAM_DATA(ripng->ibuf); @@ -1361,7 +1357,7 @@ static int ripng_read(struct thread *thread)  		zlog_warn(  			"RIPng packet comes from unknown interface %d (VRF %s)",  			ifindex, ripng->vrf_name); -		return 0; +		return;  	}  	/* Packet version mismatch checking. */ @@ -1370,7 +1366,7 @@ static int ripng_read(struct thread *thread)  			"RIPng packet version %d doesn't fit to my version %d (VRF %s)",  			packet->version, ripng->version, ripng->vrf_name);  		ripng_peer_bad_packet(ripng, &from); -		return 0; +		return;  	}  	/* Process RIPng packet. */ @@ -1387,7 +1383,6 @@ static int ripng_read(struct thread *thread)  		ripng_peer_bad_packet(ripng, &from);  		break;  	} -	return 0;  }  /* Walk down the RIPng routing table then clear changed flag. */ @@ -1410,7 +1405,7 @@ static void ripng_clear_changed_flag(struct ripng *ripng)  /* Regular update of RIPng route.  Send all routing formation to RIPng     enabled interface. */ -static int ripng_update(struct thread *t) +static void ripng_update(struct thread *t)  {  	struct ripng *ripng = THREAD_ARG(t);  	struct interface *ifp; @@ -1455,12 +1450,10 @@ static int ripng_update(struct thread *t)  	/* Reset flush event. */  	ripng_event(ripng, RIPNG_UPDATE_EVENT, 0); - -	return 0;  }  /* Triggered update interval timer. */ -static int ripng_triggered_interval(struct thread *t) +static void ripng_triggered_interval(struct thread *t)  {  	struct ripng *ripng = THREAD_ARG(t); @@ -1468,11 +1461,10 @@ static int ripng_triggered_interval(struct thread *t)  		ripng->trigger = 0;  		ripng_triggered_update(t);  	} -	return 0;  }  /* Execute triggered update. */ -int ripng_triggered_update(struct thread *t) +void ripng_triggered_update(struct thread *t)  {  	struct ripng *ripng = THREAD_ARG(t);  	struct interface *ifp; @@ -1518,8 +1510,6 @@ int ripng_triggered_update(struct thread *t)  	thread_add_timer(master, ripng_triggered_interval, ripng, interval,  			 &ripng->t_triggered_interval); - -	return 0;  }  /* Write routing table entry to the stream and return next index of  | 
