Sparse fixes: NULL use, header order, ANSI prototypes, static
[qemu] / slirp / ip_output.c
index a8a6067..5bce520 100644 (file)
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -57,9 +53,7 @@ u_int16_t ip_id;
  * The mbuf opt, if present, will not be freed.
  */
 int
-ip_output(so, m0)
-       struct socket *so;
-       struct mbuf *m0;
+ip_output(struct socket *so, struct mbuf *m0)
 {
        register struct ip *ip;
        register struct mbuf *m = m0;
@@ -139,7 +133,7 @@ ip_output(so, m0)
        for (off = hlen + len; off < (u_int16_t)ip->ip_len; off += len) {
          register struct ip *mhip;
          m = m_get();
-         if (m == 0) {
+          if (m == NULL) {
            error = -1;
            STAT(ipstat.ips_odropped++);
            goto sendorfree;
@@ -189,7 +183,7 @@ ip_output(so, m0)
 sendorfree:
        for (m = m0; m; m = m0) {
                m0 = m->m_nextpkt;
-               m->m_nextpkt = 0;
+                m->m_nextpkt = NULL;
                if (error == 0)
                        if_output(so, m);
                else