]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: show "(null)" for empty IP address
authoranlan_cs <vic.lan@pica8.com>
Wed, 11 Jan 2023 00:44:46 +0000 (08:44 +0800)
committeranlan_cs <vic.lan@pica8.com>
Thu, 19 Jan 2023 01:30:49 +0000 (09:30 +0800)
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 <vic.lan@pica8.com>
lib/prefix.c

index 4642f14d35ad0af74572a954b5aec6af32676a86..1d098f78c5e563b3eb84a9da51c13778c9341df0 100644 (file)
@@ -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) {