mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 14:05:31 +00:00
nhrpd: Use SU_ADDRSTRLEN where appropriate
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
This commit is contained in:
parent
611915ae89
commit
18cc9c4293
@ -289,7 +289,7 @@ static int nhrp_peer_defer_vici_request(struct thread *t)
|
|||||||
struct nhrp_vc *vc = p->vc;
|
struct nhrp_vc *vc = p->vc;
|
||||||
struct interface *ifp = p->ifp;
|
struct interface *ifp = p->ifp;
|
||||||
struct nhrp_interface *nifp = ifp->info;
|
struct nhrp_interface *nifp = ifp->info;
|
||||||
char buf[256];
|
char buf[SU_ADDRSTRLEN];
|
||||||
THREAD_OFF(p->t_timer);
|
THREAD_OFF(p->t_timer);
|
||||||
|
|
||||||
if (p->online) {
|
if (p->online) {
|
||||||
@ -314,7 +314,7 @@ int nhrp_peer_check(struct nhrp_peer *p, int establish)
|
|||||||
struct nhrp_vc *vc = p->vc;
|
struct nhrp_vc *vc = p->vc;
|
||||||
struct interface *ifp = p->ifp;
|
struct interface *ifp = p->ifp;
|
||||||
struct nhrp_interface *nifp = ifp->info;
|
struct nhrp_interface *nifp = ifp->info;
|
||||||
char buf[256];
|
char buf[SU_ADDRSTRLEN];
|
||||||
|
|
||||||
if (p->online)
|
if (p->online)
|
||||||
return 1;
|
return 1;
|
||||||
@ -387,7 +387,7 @@ static void nhrp_process_nat_extension(struct nhrp_packet_parser *pp,
|
|||||||
union sockunion *proto,
|
union sockunion *proto,
|
||||||
union sockunion *cie_nbma)
|
union sockunion *cie_nbma)
|
||||||
{
|
{
|
||||||
char buf[2][256];
|
char buf1[SU_ADDRSTRLEN], buf2[SU_ADDRSTRLEN];
|
||||||
union sockunion cie_proto;
|
union sockunion cie_proto;
|
||||||
struct zbuf payload;
|
struct zbuf payload;
|
||||||
struct nhrp_extension_header *ext;
|
struct nhrp_extension_header *ext;
|
||||||
@ -413,12 +413,10 @@ static void nhrp_process_nat_extension(struct nhrp_packet_parser *pp,
|
|||||||
* the neighbor table in the kernel contains the
|
* the neighbor table in the kernel contains the
|
||||||
* source NBMA address which is not reachable
|
* source NBMA address which is not reachable
|
||||||
* since it is behind a NAT device */
|
* since it is behind a NAT device */
|
||||||
|
if (!sockunion2str(proto, buf1, sizeof(buf1)))
|
||||||
|
strlcpy(buf1, "NULL", sizeof(buf1));
|
||||||
debugf(NHRP_DEBUG_COMMON,
|
debugf(NHRP_DEBUG_COMMON,
|
||||||
"Processing NAT Extension for %s",
|
"Processing NAT Extension for %s", buf1);
|
||||||
sockunion2str(proto, buf[0],
|
|
||||||
sizeof(buf[0]))
|
|
||||||
? buf[0]
|
|
||||||
: "NULL");
|
|
||||||
while (nhrp_cie_pull(&payload, pp->hdr,
|
while (nhrp_cie_pull(&payload, pp->hdr,
|
||||||
cie_nbma, &cie_proto)) {
|
cie_nbma, &cie_proto)) {
|
||||||
if (sockunion_family(&cie_proto)
|
if (sockunion_family(&cie_proto)
|
||||||
@ -426,14 +424,14 @@ static void nhrp_process_nat_extension(struct nhrp_packet_parser *pp,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!sockunion_cmp(proto, &cie_proto)) {
|
if (!sockunion_cmp(proto, &cie_proto)) {
|
||||||
|
if (!sockunion2str(cie_nbma,
|
||||||
|
buf2,
|
||||||
|
sizeof(buf2)))
|
||||||
|
strlcpy(buf2, "NULL",
|
||||||
|
sizeof(buf2));
|
||||||
debugf(NHRP_DEBUG_COMMON,
|
debugf(NHRP_DEBUG_COMMON,
|
||||||
"cie_nbma for proto %s is %s",
|
"cie_nbma for proto %s is %s",
|
||||||
buf[0] ? buf[0] : "NULL",
|
buf1, buf2);
|
||||||
sockunion2str(
|
|
||||||
cie_nbma, buf[1],
|
|
||||||
sizeof(buf[1]))
|
|
||||||
? buf[1]
|
|
||||||
: "NULL");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user