Changeset View
Changeset View
Standalone View
Standalone View
sbin/ping/main.c
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
#ifdef INET6 | #ifdef INET6 | ||||
struct in6_addr a6; | struct in6_addr a6; | ||||
bool ipv6; | bool ipv6; | ||||
ipv6 = false; | ipv6 = false; | ||||
#endif | #endif | ||||
ipv4 = false; | ipv4 = false; | ||||
#ifdef INET6 | |||||
if (strcmp(getprogname(), "ping6") == 0) | |||||
ipv6 = true; | |||||
#endif | |||||
bz: I wonder if you can merge the two INET6 blocks as
```
if (strcmp(getprogname(), "ping6") == 0)… | |||||
while ((ch = getopt(argc, argv, OPTSTR)) != -1) { | while ((ch = getopt(argc, argv, OPTSTR)) != -1) { | ||||
switch(ch) { | switch(ch) { | ||||
case '4': | case '4': | ||||
ipv4 = true; | ipv4 = true; | ||||
break; | break; | ||||
#ifdef INET6 | #ifdef INET6 | ||||
case '6': | case '6': | ||||
ipv6 = true; | ipv6 = true; | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |
I wonder if you can merge the two INET6 blocks as