mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-28 12:10:24 +00:00
bfdd: constify satostr
Detect modifications to the `sockaddr_any` struct. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
869dada534
commit
6e10bd9772
@ -1111,13 +1111,13 @@ static const char *get_diag_str(int diag)
|
||||
return "N/A";
|
||||
}
|
||||
|
||||
const char *satostr(struct sockaddr_any *sa)
|
||||
const char *satostr(const struct sockaddr_any *sa)
|
||||
{
|
||||
#define INETSTR_BUFCOUNT 8
|
||||
static char buf[INETSTR_BUFCOUNT][INET6_ADDRSTRLEN];
|
||||
static int bufidx;
|
||||
struct sockaddr_in *sin = &sa->sa_sin;
|
||||
struct sockaddr_in6 *sin6 = &sa->sa_sin6;
|
||||
const struct sockaddr_in *sin = &sa->sa_sin;
|
||||
const struct sockaddr_in6 *sin6 = &sa->sa_sin6;
|
||||
|
||||
bufidx += (bufidx + 1) % INETSTR_BUFCOUNT;
|
||||
buf[bufidx][0] = 0;
|
||||
|
@ -529,7 +529,7 @@ void bs_state_handler(struct bfd_session *bs, int nstate);
|
||||
void bs_echo_timer_handler(struct bfd_session *bs);
|
||||
void bs_final_handler(struct bfd_session *bs);
|
||||
void bs_set_slow_timers(struct bfd_session *bs);
|
||||
const char *satostr(struct sockaddr_any *sa);
|
||||
const char *satostr(const struct sockaddr_any *sa);
|
||||
const char *diag2str(uint8_t diag);
|
||||
int strtosa(const char *addr, struct sockaddr_any *sa);
|
||||
void integer2timestr(uint64_t time, char *buf, size_t buflen);
|
||||
|
Loading…
Reference in New Issue
Block a user