diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index c0c467c3e127..fcc84336083f 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -396,7 +396,7 @@ mb_free_ext(struct mbuf *m) * and bump the refcount of the cluster. */ static void -mb_dupcl(struct mbuf *n, struct mbuf *m) +mb_dupcl(struct mbuf *n, const struct mbuf *m) { KASSERT(m->m_flags & M_EXT, ("%s: M_EXT not set on %p", __func__, m)); @@ -567,7 +567,7 @@ m_move_pkthdr(struct mbuf *to, struct mbuf *from) * In particular, this does a deep copy of the packet tags. */ int -m_dup_pkthdr(struct mbuf *to, struct mbuf *from, int how) +m_dup_pkthdr(struct mbuf *to, const struct mbuf *from, int how) { #if 0 @@ -631,7 +631,7 @@ m_prepend(struct mbuf *m, int len, int how) * only their reference counts are incremented. */ struct mbuf * -m_copym(struct mbuf *m, int off0, int len, int wait) +m_copym(const struct mbuf *m, int off0, int len, int wait) { struct mbuf *n, **np; int off = off0; @@ -785,7 +785,7 @@ m_copydata(const struct mbuf *m, int off, int len, caddr_t cp) * you need a writable copy of an mbuf chain. */ struct mbuf * -m_dup(struct mbuf *m, int how) +m_dup(const struct mbuf *m, int how) { struct mbuf **p, *top = NULL; int remain, moff, nsize; diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c index d14eab3c5672..af240a176965 100644 --- a/sys/kern/uipc_mbuf2.c +++ b/sys/kern/uipc_mbuf2.c @@ -427,7 +427,7 @@ m_tag_copy(struct m_tag *t, int how) * destination mbuf. */ int -m_tag_copy_chain(struct mbuf *to, struct mbuf *from, int how) +m_tag_copy_chain(struct mbuf *to, const struct mbuf *from, int how) { struct m_tag *p, *t, *tprev = NULL; diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 39a41d3a40d7..8d335507456a 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -953,7 +953,7 @@ int m_extadd(struct mbuf *, caddr_t, u_int, struct mbuf *m_collapse(struct mbuf *, int, int); void m_copyback(struct mbuf *, int, int, c_caddr_t); void m_copydata(const struct mbuf *, int, int, caddr_t); -struct mbuf *m_copym(struct mbuf *, int, int, int); +struct mbuf *m_copym(const struct mbuf *, int, int, int); struct mbuf *m_copypacket(struct mbuf *, int); void m_copy_pkthdr(struct mbuf *, struct mbuf *); struct mbuf *m_copyup(struct mbuf *, int, int); @@ -962,8 +962,8 @@ void m_demote_pkthdr(struct mbuf *); void m_demote(struct mbuf *, int, int); struct mbuf *m_devget(char *, int, int, struct ifnet *, void (*)(char *, caddr_t, u_int)); -struct mbuf *m_dup(struct mbuf *, int); -int m_dup_pkthdr(struct mbuf *, struct mbuf *, int); +struct mbuf *m_dup(const struct mbuf *, int); +int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int); u_int m_fixhdr(struct mbuf *); struct mbuf *m_fragment(struct mbuf *, int, int); void m_freem(struct mbuf *); @@ -1070,7 +1070,7 @@ void m_tag_delete_chain(struct mbuf *, struct m_tag *); void m_tag_free_default(struct m_tag *); struct m_tag *m_tag_locate(struct mbuf *, u_int32_t, int, struct m_tag *); struct m_tag *m_tag_copy(struct m_tag *, int); -int m_tag_copy_chain(struct mbuf *, struct mbuf *, int); +int m_tag_copy_chain(struct mbuf *, const struct mbuf *, int); void m_tag_delete_nonpersistent(struct mbuf *); /*