From: Joseph C. Lehner Date: Sat, 7 Sep 2019 08:55:12 +0000 (+0200) Subject: Show netmask as /%d X-Git-Tag: v0.9.14~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=021e449007e8742ef7725ce0e55aeeaf8f74c16c;p=oweals%2Fnmrpflash.git Show netmask as /%d --- diff --git a/README.md b/README.md index 880e0ce..56f7619 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ immediately after starting `nmrpflash`. # nmrpflash -i eth0 -f EX2700-V1.0.1.8.img Advertising NMRP server on eth0 ... / Received configuration request from a4:2b:8c:00:00:01. -Sending configuration: ip 10.164.183.252, mask 255.255.255.0. +Sending configuration: 10.164.183.252/24 Received upload request: filename 'firmware'. Uploading EX2700-V1.0.1.8.img ... Upload successful. diff --git a/nmrp.c b/nmrp.c index 3f7c7b8..e4fcbf1 100644 --- a/nmrp.c +++ b/nmrp.c @@ -541,8 +541,8 @@ int nmrp_do(struct nmrpd_args *args) memcpy(tx.eh.ether_dhost, rx.eh.ether_shost, 6); - printf("Sending configuration: %s, netmask %s.\n", - args->ipaddr, args->ipmask); + printf("Sending configuration: %s/%d.\n", + args->ipaddr, bitcount(ipmask.s_addr)); if (ethsock_arp_add(sock, rx.eh.ether_shost, ipaddr.s_addr, &arp_undo) != 0) { goto out;