summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2006-06-06 11:21:08 +0000
committerglebius <glebius@FreeBSD.org>2006-06-06 11:21:08 +0000
commit4670d657ec1c5b5823426430da34e8b4a5aab0f0 (patch)
treef9dd284bd03223c2fd4097b284e0117105defefc /sbin/ifconfig
parentabd4afc6be28a73083acf5c85a3108932f2dd7ab (diff)
downloadFreeBSD-src-4670d657ec1c5b5823426430da34e8b4a5aab0f0.zip
FreeBSD-src-4670d657ec1c5b5823426430da34e8b4a5aab0f0.tar.gz
Print pfsync interface status if either syncpeer or syncdev is configured.
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifpfsync.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sbin/ifconfig/ifpfsync.c b/sbin/ifconfig/ifpfsync.c
index 413cd74..2a388a1 100644
--- a/sbin/ifconfig/ifpfsync.c
+++ b/sbin/ifconfig/ifpfsync.c
@@ -173,13 +173,18 @@ pfsync_status(int s)
if (ioctl(s, SIOCGETPFSYNC, (caddr_t)&ifr) == -1)
return;
- if (preq.pfsyncr_syncdev[0] != '\0') {
- printf("\tpfsync: syncdev: %s ", preq.pfsyncr_syncdev);
- if (preq.pfsyncr_syncpeer.s_addr != INADDR_PFSYNC_GROUP)
- printf("syncpeer: %s ",
- inet_ntoa(preq.pfsyncr_syncpeer));
+ if (preq.pfsyncr_syncdev[0] != '\0' ||
+ preq.pfsyncr_syncpeer.s_addr != INADDR_PFSYNC_GROUP)
+ printf("\t");
+
+ if (preq.pfsyncr_syncdev[0] != '\0')
+ printf("pfsync: syncdev: %s ", preq.pfsyncr_syncdev);
+ if (preq.pfsyncr_syncpeer.s_addr != INADDR_PFSYNC_GROUP)
+ printf("syncpeer: %s ", inet_ntoa(preq.pfsyncr_syncpeer));
+
+ if (preq.pfsyncr_syncdev[0] != '\0' ||
+ preq.pfsyncr_syncpeer.s_addr != INADDR_PFSYNC_GROUP)
printf("maxupd: %d\n", preq.pfsyncr_maxupdates);
- }
}
static struct cmd pfsync_cmds[] = {
OpenPOWER on IntegriCloud