]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Update comment style.
authorRoy Marples <roy@marples.name>
Tue, 29 Jan 2008 11:20:55 +0000 (11:20 +0000)
committerRoy Marples <roy@marples.name>
Tue, 29 Jan 2008 11:20:55 +0000 (11:20 +0000)
arp.c
client.c
configure.c
dhcp.c
interface.c
socket.c

diff --git a/arp.c b/arp.c
index 542fe07a77461550efbe7688e4b8588d358950ff..6d4f5bc8b42b236bdf3f993f9e655b8a115e7a3f 100644 (file)
--- a/arp.c
+++ b/arp.c
@@ -261,7 +261,7 @@ int arp_claim (interface_t *iface, struct in_addr address)
                                continue;
 
                        /* Some systems send a reply back from our hwaddress,
-                        * which is weird */
+                        * which is wierd */
                        if (reply->ar_hln == iface->hwlen &&
                            memcmp (rh.c, iface->hwaddr, iface->hwlen) == 0)
                                continue;
index 5d82cc73c0b9e6e3cb736c2e5c358f3139b1f829..17f0d589f1baf607568e40e6b8a7d15b2cb811e9 100644 (file)
--- a/client.c
+++ b/client.c
 #endif
 
 /* We need this for our maximum timeout as FreeBSD's select cannot handle
  any higher than this. Is there a better way of working this out? */
* any higher than this. Is there a better way of working this out? */
 #define SELECT_MAX              100000000
 
 /* This is out mini timeout.
  Basically we resend the last request every TIMEOUT_MINI seconds. */
* Basically we resend the last request every TIMEOUT_MINI seconds. */
 #define TIMEOUT_MINI            3
 /* Except for an infinite timeout. We keep adding TIMEOUT_MINI to
  ourself until TIMEOUT_MINI_INF is reached. */
* ourself until TIMEOUT_MINI_INF is reached. */
 #define TIMEOUT_MINI_INF        60
 
 #define STATE_INIT              0
@@ -802,7 +802,7 @@ static int handle_dhcp (state_t *state, int type, const options_t *options)
                        state->state = STATE_INIT;
 
                        /* RFC 2131 says that we should wait for 10 seconds
-                          before doing anything else */
+                        * before doing anything else */
                        logger (LOG_INFO, "sleeping for 10 seconds");
                        tv.tv_sec = 10;
                        tv.tv_usec = 0;
@@ -916,16 +916,16 @@ static int handle_packet (state_t *state, const options_t *options)
        dhcpmessage_t message;
 
        /* Allocate our buffer space for BPF.
-          We cannot do this until we have opened our socket as we don't
-          know how much of a buffer we need until then. */
+        * We cannot do this until we have opened our socket as we don't
+        * know how much of a buffer we need until then. */
        if (! state->buffer)
                state->buffer = xmalloc (iface->buffer_length);
        state->buffer_len = iface->buffer_length;
        state->buffer_pos = 0;
 
        /* We loop through until our buffer is empty.
-          The benefit is that if we get >1 DHCP packet in our buffer and
-          the first one fails for any reason, we can use the next. */
+        * The benefit is that if we get >1 DHCP packet in our buffer and
+        * the first one fails for any reason, we can use the next. */
 
        memset (&message, 0, sizeof (message));
        new_dhcp = xmalloc (sizeof (*new_dhcp));
@@ -954,8 +954,8 @@ static int handle_packet (state_t *state, const options_t *options)
                }
 
                /* If we got here then the DHCP packet is valid and appears to
-                  be for us, so let's clear the buffer as we don't care about
-                  any more DHCP packets at this point. */
+                * be for us, so let's clear the buffer as we don't care about
+                * any more DHCP packets at this point. */
                valid = true;
                break;
        } while (state->buffer_pos != 0);
index 47a0e263359945f544b381787e679a6686c70577..4fb36c5015bc900a803f0fde9a01b7908317e96e 100644 (file)
@@ -245,8 +245,9 @@ static int _make_ntp (const char *file, const char *ifname, const dhcp_t *dhcp)
        for (address = dhcp->ntpservers; address; address = address->next)
                tomatch++;
 
-       /* Check that we really need to update the servers
-          We do this because ntp has to be restarted to work with a changed config */
+       /* Check that we really need to update the servers.
+        * We do this because ntp has to be restarted to
+        * work with a changed config. */
        if (! (f = fopen (file, "r"))) {
                if (errno != ENOENT) {
                        logger (LOG_ERR, "fopen `%s': %s",
@@ -311,9 +312,9 @@ next:
 
 static int make_ntp (const char *ifname, const dhcp_t *dhcp)
 {
-       /* On some systems we have only have one ntp service, but we don't know
-          which configuration file we're using. So we need to write to both and
-          restart accordingly. */
+       /* On some systems we have only have one ntp service, but we don't
+        * know which configuration file we're using. So we need to write
+        * to both and restart accordingly. */
 
        bool restart_ntp = false;
        bool restart_openntp = false;
@@ -515,9 +516,9 @@ int configure (const options_t *options, interface_t *iface,
        if (dhcp->address.s_addr == 0)
                up = 0;
 
-       /* Remove old routes
-          Always do this as the interface may have >1 address not added by us
-          so the routes we added may still exist */
+       /* Remove old routes.
+        * Always do this as the interface may have >1 address not added by us
+        * so the routes we added may still exist. */
        for (route = iface->previous_routes; route; route = route->next)
                if ((route->destination.s_addr || options->dogateway) &&
                    (! up || ! in_routes (dhcp->routes, route)))
@@ -564,8 +565,8 @@ int configure (const options_t *options, interface_t *iface,
        }
 
        /* Set the MTU requested.
-          If the DHCP server no longer sends one OR it's invalid then
-          we restore the original MTU */
+        * If the DHCP server no longer sends one OR it's invalid then
+        * we restore the original MTU */
        if (options->domtu) {
                unsigned short mtu = iface->mtu;
                if (dhcp->mtu)
@@ -776,4 +777,3 @@ int configure (const options_t *options, interface_t *iface,
 
        return (0);
 }
-
diff --git a/dhcp.c b/dhcp.c
index 0f49c49b18c8792489466c93987e4bd57a7949c2..838d6058dff5fdde2e9a3d9c80e537e2b0e4a208 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -216,8 +216,8 @@ ssize_t send_message (const interface_t *iface, const dhcp_t *dhcp,
                *p++ = 0;
 
                /* Only request DNSSERVER in discover to keep the packets small.
-                  RFC2131 Section 3.5 states that the REQUEST must include the
-                  list from the DISCOVER message, so I think this is ok. */
+                * RFC2131 Section 3.5 states that the REQUEST must include the
+                * list from the DISCOVER message, so I think this is ok. */
 
                if (type == DHCP_DISCOVER && ! options->test)
                        *p++ = DHCP_DNSSERVER;
@@ -370,7 +370,8 @@ ssize_t send_message (const interface_t *iface, const dhcp_t *dhcp,
 
 #ifdef BOOTP_MESSAGE_LENTH_MIN
        /* Some crappy DHCP servers think they have to obey the BOOTP minimum
-        * messag length. They are wrong, but we should still cater for them */
+        * message length.
+        * They are wrong, but we should still cater for them. */
        while (p - m < BOOTP_MESSAGE_LENTH_MIN)
                *p++ = DHCP_PAD;
 #endif
@@ -392,9 +393,9 @@ ssize_t send_message (const interface_t *iface, const dhcp_t *dhcp,
 }
 
 /* Decode an RFC3397 DNS search order option into a space
  seperated string. Returns length of string (including 
  terminating zero) or zero on error. out may be NULL
  to just determine output length. */
* seperated string. Returns length of string (including 
* terminating zero) or zero on error. out may be NULL
* to just determine output length. */
 static unsigned int decode_search (const unsigned char *p, int len, char *out)
 {
        const unsigned char *r, *q = p;
@@ -958,7 +959,7 @@ eexit:
                        ~dhcp->netmask.s_addr;
 
        /* If we have classess static routes then we discard
-          static routes and routers according to RFC 3442 */
+        * static routes and routers according to RFC 3442 */
        if (csr) {
                dhcp->routes = csr;
                free_route (mscsr);
index 1aaf48aee6a004107ab7e6ac44685f6f2ca232e9..28636e35638ad670b3e63f6a307fbc7818d32e33 100644 (file)
@@ -680,10 +680,9 @@ static int do_route (const char *ifname,
 
 #elif __linux__
 /* This netlink stuff is overly compex IMO.
-   The BSD implementation is much cleaner and a lot less code.
-   send_netlink handles the actual transmission so we can work out
-   if there was an error or not.
-   */
+ * The BSD implementation is much cleaner and a lot less code.
+ * send_netlink handles the actual transmission so we can work out
+ * if there was an error or not. */
 #define BUFFERLEN 256
 static int send_netlink(struct nlmsghdr *hdr)
 {
index 830a41f25ac0761a609425cb276d4ca03d5a9aca..626fbe4f1705a5fa81c6c66b0fb2a50b901bd45c 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -61,7 +61,7 @@
 #include "socket.h"
 
 /* A suitably large buffer for all transactions.
  BPF buffer size is set by the kernel, so no define. */
* BPF buffer size is set by the kernel, so no define. */
 #ifdef __linux__
 # define BUFFER_LENGTH 4096
 #endif
@@ -74,7 +74,7 @@ static const uint8_t ipv4_bcast_addr[] = {
 };
 
 /* Credit where credit is due :)
  The below BPF filter is taken from ISC DHCP */
* The below BPF filter is taken from ISC DHCP */
 static struct bpf_insn dhcp_bpf_filter [] = {
        /* Make sure this is an IP packet... */
        BPF_STMT (BPF_LD | BPF_H | BPF_ABS, 12),
@@ -169,13 +169,13 @@ void make_dhcp_packet(struct udp_dhcp_packet *packet,
        struct udphdr *udp = &packet->udp;
 
        /* OK, this is important :)
-          We copy the data to our packet and then create a small part of the
-          ip structure and an invalid ip_len (basically udp length).
-          We then fill the udp structure and put the checksum
-          of the whole packet into the udp checksum.
-          Finally we complete the ip structure and ip checksum.
-          If we don't do the ordering like so then the udp checksum will be
-          broken, so find another way of doing it! */
+        * We copy the data to our packet and then create a small part of the
+        * ip structure and an invalid ip_len (basically udp length).
+        * We then fill the udp structure and put the checksum
+        * of the whole packet into the udp checksum.
+        * Finally we complete the ip structure and ip checksum.
+        * If we don't do the ordering like so then the udp checksum will be
+        * broken, so find another way of doing it! */
 
        memcpy (&packet->dhcp, data, length);
 
@@ -364,7 +364,7 @@ ssize_t send_packet (const interface_t *iface, int type,
 }
 
 /* BPF requires that we read the entire buffer.
  So we pass the buffer in the API so we can loop on >1 dhcp packet. */
* So we pass the buffer in the API so we can loop on >1 dhcp packet. */
 ssize_t get_packet (const interface_t *iface, unsigned char *data,
                    unsigned char *buffer,
                    size_t *buffer_len, size_t *buffer_pos)
@@ -561,7 +561,7 @@ ssize_t send_packet (const interface_t *iface, int type,
 }
 
 /* Linux has no need for the buffer as we can read as much as we want.
  We only have the buffer listed to keep the same API. */
* We only have the buffer listed to keep the same API. */
 ssize_t get_packet (const interface_t *iface, unsigned char *data,
                    unsigned char *buffer,
                    size_t *buffer_len, size_t *buffer_pos)