processppp: fix IP log when tunnel IP source change

fmtaddr formats the string to a static buffer that must be selected
manually, but this log message was re-using the same buffer.

Use another index for 2nd IP so we get to know which is what.

Fixes: 2429969bd04d ("Add L2TP offloading support")
This commit is contained in:
Dominique Martinet 2023-08-02 19:23:13 +09:00 committed by Samuel Thibault
parent 1b9c50df98
commit c8c197bf3a

View file

@ -4738,7 +4738,7 @@ static void processppp(sessionidt s, uint8_t *buf, int len, uint8_t *p, int l, s
{
// The remotes BAS are a clustered l2tpns server and the source IP has changed
LOG(2, s, t, "The tunnel IP source (%s) has changed by new IP (%s)\n",
fmtaddr(htonl(tunnel[t].ip), 0), fmtaddr(addr->sin_addr.s_addr, 0));
fmtaddr(htonl(tunnel[t].ip), 0), fmtaddr(addr->sin_addr.s_addr, 1));
tunnel[t].ip = ntohl(addr->sin_addr.s_addr);