- LOG(1, ip, 0, 0, "Route %s %u.%u.%u.%u/%u.%u.%u.%u %u.%u.%u.%u\n",
- add ? "add" : "del",
- ip >> 24, ip >> 16 & 0xff, ip >> 8 & 0xff, ip & 0xff,
- mask >> 24, mask >> 16 & 0xff, mask >> 8 & 0xff, mask & 0xff,
- gw >> 24, gw >> 16 & 0xff, gw >> 8 & 0xff, gw & 0xff);
+ LOG(1, s, 0, "Route %s %s/%s%s%s\n", add ? "add" : "del",
+ fmtaddr(htonl(ip), 0), fmtaddr(htonl(mask), 1),
+ gw ? " via" : "", gw ? fmtaddr(htonl(gw), 2) : "");