- fix zcip for IMA compile mode.
rename usage() to zcip_usage, make struct arp_packet static. This applet is not ISO C89 compatible due to the use of C99-style comments ("c++ comments).
This commit is contained in:
parent
10fb2b71f3
commit
b7d5342003
@ -65,7 +65,7 @@
|
|||||||
#include <linux/sockios.h>
|
#include <linux/sockios.h>
|
||||||
|
|
||||||
|
|
||||||
struct arp_packet {
|
static struct arp_packet {
|
||||||
struct ether_header hdr;
|
struct ether_header hdr;
|
||||||
// FIXME this part is netinet/if_ether.h "struct ether_arp"
|
// FIXME this part is netinet/if_ether.h "struct ether_arp"
|
||||||
struct arphdr arp;
|
struct arphdr arp;
|
||||||
@ -215,7 +215,7 @@ bad:
|
|||||||
* Print usage information.
|
* Print usage information.
|
||||||
*/
|
*/
|
||||||
static void __attribute__((noreturn))
|
static void __attribute__((noreturn))
|
||||||
usage(const char *msg)
|
zcip_usage(const char *msg)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: %s\n", prog, msg);
|
fprintf(stderr, "%s: %s\n", prog, msg);
|
||||||
#ifdef NO_BUSYBOX
|
#ifdef NO_BUSYBOX
|
||||||
@ -284,7 +284,7 @@ int zcip_main(int argc, char *argv[])
|
|||||||
if (inet_aton(optarg, &ip) == 0
|
if (inet_aton(optarg, &ip) == 0
|
||||||
|| (ntohl(ip.s_addr) & IN_CLASSB_NET)
|
|| (ntohl(ip.s_addr) & IN_CLASSB_NET)
|
||||||
!= LINKLOCAL_ADDR) {
|
!= LINKLOCAL_ADDR) {
|
||||||
usage("invalid link address");
|
zcip_usage("invalid link address");
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
case 'v':
|
case 'v':
|
||||||
@ -294,7 +294,7 @@ int zcip_main(int argc, char *argv[])
|
|||||||
foreground = 1;
|
foreground = 1;
|
||||||
continue;
|
continue;
|
||||||
default:
|
default:
|
||||||
usage("bad option");
|
zcip_usage("bad option");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (optind < argc - 1) {
|
if (optind < argc - 1) {
|
||||||
@ -303,7 +303,7 @@ int zcip_main(int argc, char *argv[])
|
|||||||
script = argv[optind++];
|
script = argv[optind++];
|
||||||
}
|
}
|
||||||
if (optind != argc || !intf)
|
if (optind != argc || !intf)
|
||||||
usage("wrong number of arguments");
|
zcip_usage("wrong number of arguments");
|
||||||
openlog(prog, 0, LOG_DAEMON);
|
openlog(prog, 0, LOG_DAEMON);
|
||||||
|
|
||||||
// initialize the interface (modprobe, ifup, etc)
|
// initialize the interface (modprobe, ifup, etc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user