Skip to content

Commit

Permalink
pimd: constify peer lookup function
Browse files Browse the repository at this point in the history
Make parameter `const` to document that the variable will not change.

Signed-off-by: Rafael Zalamena <[email protected]>
  • Loading branch information
rzalamena committed Nov 20, 2024
1 parent 8f829b2 commit 1e0629f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pimd/pim_msdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,8 +1066,7 @@ struct pim_msdp_peer *pim_msdp_peer_add(struct pim_instance *pim,
return mp;
}

struct pim_msdp_peer *pim_msdp_peer_find(struct pim_instance *pim,
struct in_addr peer_addr)
struct pim_msdp_peer *pim_msdp_peer_find(const struct pim_instance *pim, struct in_addr peer_addr)
{
struct pim_msdp_peer lookup;

Expand Down
3 changes: 1 addition & 2 deletions pimd/pim_msdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ void pim_msdp_init(struct pim_instance *pim, struct event_loop *master);
void pim_msdp_exit(struct pim_instance *pim);
char *pim_msdp_state_dump(enum pim_msdp_peer_state state, char *buf,
int buf_size);
struct pim_msdp_peer *pim_msdp_peer_find(struct pim_instance *pim,
struct in_addr peer_addr);
struct pim_msdp_peer *pim_msdp_peer_find(const struct pim_instance *pim, struct in_addr peer_addr);
void pim_msdp_peer_established(struct pim_msdp_peer *mp);
void pim_msdp_peer_pkt_rxed(struct pim_msdp_peer *mp);
void pim_msdp_peer_stop_tcp_conn(struct pim_msdp_peer *mp, bool chg_state);
Expand Down

0 comments on commit 1e0629f

Please sign in to comment.