112 |
u_char *patptr = NULL; |
u_char *patptr = NULL; |
113 |
int is_root = getuid () == 0; |
int is_root = getuid () == 0; |
114 |
|
|
115 |
|
if ((ping = ping_init (ICMP_ECHO, getpid ())) == NULL) |
116 |
|
{ |
117 |
|
fprintf (stderr, "can't init ping: %s\n", strerror (errno)); |
118 |
|
exit (1); |
119 |
|
} |
120 |
|
ping_set_sockopt (ping, SO_BROADCAST, (char *)&one, sizeof (one)); |
121 |
|
|
122 |
/* Parse command line */ |
/* Parse command line */ |
123 |
while ((c = getopt_long (argc, argv, short_options, long_options, NULL)) |
while ((c = getopt_long (argc, argv, short_options, long_options, NULL)) |
124 |
!= EOF) |
!= EOF) |
221 |
} |
} |
222 |
} |
} |
223 |
|
|
224 |
|
/* Reset root privileges */ |
225 |
|
setuid (getuid ()); |
226 |
|
|
227 |
argc -= optind; |
argc -= optind; |
228 |
argv += optind; |
argv += optind; |
229 |
if (argc == 0) |
if (argc == 0) |