From: anlan_cs Date: Wed, 11 Jan 2023 00:44:46 +0000 (+0800) Subject: lib: show "(null)" for empty IP address X-Git-Tag: base_8.5~54^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=927c633dd9813703534ec8d4bed20f1461e044f8;p=matthieu%2Ffrr.git lib: show "(null)" for empty IP address Use "(null)" for empty IP address. One example in `bgp_zebra_send_remote_macip()` to install mac: Before: ``` 2023/01/18 02:09:09 BGP: [SCHS5-AK960] Tx ADD MACIP, VNI 200 MAC 06:6b:7c:db:83:72 IP flags 0x0 seq 0 remote VTEP 88.88.88.88 esi - ``` After: ``` 2023/01/18 20:19:57 BGP: [SCHS5-AK960] Tx ADD MACIP, VNI 200 MAC 06:6b:7c:db:83:72 IP (null) flags 0x0 seq 0 remote VTEP 88.88.88.88 esi - ``` Signed-off-by: anlan_cs --- diff --git a/lib/prefix.c b/lib/prefix.c index 4642f14d35..1d098f78c5 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -1489,7 +1489,7 @@ static ssize_t printfrr_ia(struct fbuf *buf, struct printfrr_eargs *ea, ea->fmt++; } - if (!ipa) + if (!ipa || !ipa->ipa_type) return bputs(buf, "(null)"); if (use_star) {