BSD 4_3_Tahoe release
[unix-history] / usr / src / sys / netinet / raw_ip.c
index b3bb3e3..43eeb1a 100644 (file)
@@ -1,9 +1,20 @@
 /*
 /*
- * Copyright (c) 1982 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
  *
  *
- *     @(#)raw_ip.c    6.7 (Berkeley) %G%
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *     @(#)raw_ip.c    7.4 (Berkeley) 6/29/88
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -136,7 +147,7 @@ rip_ctloutput(op, so, level, optname, m)
                                (*m)->m_off = rp->rcb_options->m_off;
                                (*m)->m_len = rp->rcb_options->m_len;
                                bcopy(mtod(rp->rcb_options, caddr_t),
                                (*m)->m_off = rp->rcb_options->m_off;
                                (*m)->m_len = rp->rcb_options->m_len;
                                bcopy(mtod(rp->rcb_options, caddr_t),
-                                   mtod(*m, caddr_t), (*m)->m_len);
+                                   mtod(*m, caddr_t), (unsigned)(*m)->m_len);
                        } else
                                (*m)->m_len = 0;
                        break;
                        } else
                                (*m)->m_len = 0;
                        break;
@@ -146,7 +157,7 @@ rip_ctloutput(op, so, level, optname, m)
                }
                break;
        }
                }
                break;
        }
-       if (op == PRCO_SETOPT)
-               m_free(*m);
+       if (op == PRCO_SETOPT && *m)
+               (void)m_free(*m);
        return (error);
 }
        return (error);
 }