summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rarpd/rarpd.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2013-04-07 15:33:06 +0000
committermarius <marius@FreeBSD.org>2013-04-07 15:33:06 +0000
commit79b18999343394e8e54219cbd8f36e56edb0e7d7 (patch)
treee7b54f3fc1d84a139c2da38184b5759667d4821f /usr.sbin/rarpd/rarpd.c
parentfd361c8faa4d088e398aecb3ed9d37552daae541 (diff)
downloadFreeBSD-src-79b18999343394e8e54219cbd8f36e56edb0e7d7.zip
FreeBSD-src-79b18999343394e8e54219cbd8f36e56edb0e7d7.tar.gz
Add some missing newlines and static declarations.
MFC after: 3 days
Diffstat (limited to 'usr.sbin/rarpd/rarpd.c')
-rw-r--r--usr.sbin/rarpd/rarpd.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index 5386185..74f7940 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -90,13 +90,13 @@ struct if_info {
* The list of all interfaces that are being listened to. rarp_loop()
* "selects" on the descriptors in this list.
*/
-struct if_info *iflist;
+static struct if_info *iflist;
-int verbose; /* verbose messages */
-const char *tftp_dir = TFTP_DIR; /* tftp directory */
+static int verbose; /* verbose messages */
+static const char *tftp_dir = TFTP_DIR; /* tftp directory */
-int dflag; /* messages to stdout/stderr, not syslog(3) */
-int sflag; /* ignore /tftpboot */
+static int dflag; /* messages to stdout/stderr, not syslog(3) */
+static int sflag; /* ignore /tftpboot */
static u_char zero[6];
@@ -308,6 +308,7 @@ init_one(struct ifaddrs *ifa, char *target, int pass1)
break;
}
}
+
/*
* Initialize all "candidate" interfaces that are in the system
* configuration list. A "candidate" is up, not loopback and not
@@ -369,6 +370,7 @@ init(char *target)
static void
usage(void)
{
+
(void)fprintf(stderr, "%s\n%s\n",
"usage: rarpd -a [-dfsv] [-t directory] [-P pidfile]",
" rarpd [-dfsv] [-t directory] [-P pidfile] interface");
@@ -630,6 +632,7 @@ rarp_bootable_err:
static in_addr_t
choose_ipaddr(in_addr_t **alist, in_addr_t net, in_addr_t netmask)
{
+
for (; *alist; ++alist)
if ((**alist & netmask) == net)
return **alist;
@@ -692,16 +695,18 @@ rarp_process(struct if_info *ii, u_char *pkt, u_int len)
* host (i.e. the guy running rarpd), won't try to ARP for the hardware
* address of the guy being booted (he cannot answer the ARP).
*/
-struct sockaddr_in sin_inarp = {
+static struct sockaddr_in sin_inarp = {
sizeof(struct sockaddr_in), AF_INET, 0,
{0},
{0},
};
-struct sockaddr_dl sin_dl = {
+
+static struct sockaddr_dl sin_dl = {
sizeof(struct sockaddr_dl), AF_LINK, 0, IFT_ETHER, 0, 6,
0, ""
};
-struct {
+
+static struct {
struct rt_msghdr rthdr;
char rtspace[512];
} rtmsg;
@@ -883,6 +888,7 @@ rarp_reply(struct if_info *ii, struct ether_header *ep, in_addr_t ipaddr,
static in_addr_t
ipaddrtonetmask(in_addr_t addr)
{
+
addr = ntohl(addr);
if (IN_CLASSA(addr))
return htonl(IN_CLASSA_NET);
OpenPOWER on IntegriCloud