diff options
author | Rob Landley | 2006-02-22 17:01:00 +0000 |
---|---|---|
committer | Rob Landley | 2006-02-22 17:01:00 +0000 |
commit | 0a7c8ef6e220b5f8fff4f2cb0af630255a2a6a58 (patch) | |
tree | f32eb89325299a3abade721ffe149b0e516747c1 /networking | |
parent | fb16d5c6aa8aef30d313356b5a83ef0a60114c9a (diff) | |
download | busybox-0a7c8ef6e220b5f8fff4f2cb0af630255a2a6a58.zip busybox-0a7c8ef6e220b5f8fff4f2cb0af630255a2a6a58.tar.gz |
Patch from Denis Vlasenko to constify things and fix a few typos.
Diffstat (limited to 'networking')
-rw-r--r-- | networking/libiproute/ipaddress.c | 23 | ||||
-rw-r--r-- | networking/udhcp/packet.c | 7 |
2 files changed, 19 insertions, 11 deletions
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index 9db79eac..d7a0c51 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c @@ -416,7 +416,8 @@ static void ipaddr_reset_filter(int _oneline) extern int ipaddr_list_or_flush(int argc, char **argv, int flush) { - const char *option[] = { "to", "scope", "up", "label", "dev", 0 }; + static const char *const option[] = { "to", "scope", "up", "label", "dev", 0 }; + struct nlmsg_list *linfo = NULL; struct nlmsg_list *ainfo = NULL; struct nlmsg_list *l; @@ -499,7 +500,7 @@ extern int ipaddr_list_or_flush(int argc, char **argv, int flush) if (filter_dev) { filter.ifindex = ll_name_to_index(filter_dev); if (filter.ifindex <= 0) { - bb_error_msg("Device \"%s\" does not exist.", filter_dev); + bb_error_msg("Device \"%s\" does not exist", filter_dev); return -1; } } @@ -631,8 +632,11 @@ static int default_scope(inet_prefix *lcl) static int ipaddr_modify(int cmd, int argc, char **argv) { - const char *option[] = { "peer", "remote", "broadcast", "brd", - "anycast", "scope", "dev", "label", "local", 0 }; + static const char *const option[] = { + "peer", "remote", "broadcast", "brd", + "anycast", "scope", "dev", "label", "local", 0 + }; + struct rtnl_handle rth; struct { struct nlmsghdr n; @@ -716,7 +720,7 @@ static int ipaddr_modify(int cmd, int argc, char **argv) uint32_t scope = 0; NEXT_ARG(); if (rtnl_rtscope_a2n(&scope, *argv)) { - invarg(*argv, "invalid scope value."); + invarg(*argv, "invalid scope value"); } req.ifa.ifa_scope = scope; scoped = 1; @@ -749,11 +753,11 @@ static int ipaddr_modify(int cmd, int argc, char **argv) } if (d == NULL) { - bb_error_msg("Not enough information: \"dev\" argument is required."); + bb_error_msg("Not enough information: \"dev\" argument is required"); return -1; } if (l && matches(d, l) != 0) { - bb_error_msg_and_die("\"dev\" (%s) must match \"label\" (%s).", d, l); + bb_error_msg_and_die("\"dev\" (%s) must match \"label\" (%s)", d, l); } if (peer_len == 0 && local_len && cmd != RTM_DELADDR) { @@ -803,7 +807,10 @@ static int ipaddr_modify(int cmd, int argc, char **argv) extern int do_ipaddr(int argc, char **argv) { - const char *commands[] = { "add", "delete", "list", "show", "lst", "flush", 0 }; + static const char *const commands[] = { + "add", "delete", "list", "show", "lst", "flush", 0 + }; + int command_num = 2; if (*argv) { diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c index 222dd24..fe74b82 100644 --- a/networking/udhcp/packet.c +++ b/networking/udhcp/packet.c @@ -46,12 +46,13 @@ void init_header(struct dhcpMessage *packet, char type) /* read a packet from socket fd, return -1 on read error, -2 on packet error */ int get_packet(struct dhcpMessage *packet, int fd) { - int bytes; - int i; - const char broken_vendors[][8] = { + static const char broken_vendors[][8] = { "MSFT 98", "" }; + + int bytes; + int i; char unsigned *vendor; memset(packet, 0, sizeof(struct dhcpMessage)); |