Mark sun_noname as const since it's immutable. Update definitions

of functions that potentially accept &sun_noname (sbappendaddr(),
et al) to accept a const sockaddr pointer.
This commit is contained in:
rwatson 2004-06-04 04:07:08 +00:00
parent b5cd9ba03c
commit 87449e4f90
4 changed files with 8 additions and 8 deletions

View File

@ -737,7 +737,7 @@ sbinsertoob(sb, m0)
int
sbappendaddr(sb, asa, m0, control)
struct sockbuf *sb;
struct sockaddr *asa;
const struct sockaddr *asa;
struct mbuf *m0, *control;
{
struct mbuf *m, *n, *nlast;

View File

@ -737,7 +737,7 @@ sbinsertoob(sb, m0)
int
sbappendaddr(sb, asa, m0, control)
struct sockbuf *sb;
struct sockaddr *asa;
const struct sockaddr *asa;
struct mbuf *m0, *control;
{
struct mbuf *m, *n, *nlast;

View File

@ -78,7 +78,7 @@ static struct unp_head unp_shead, unp_dhead;
* need a proper out-of-band
* lock pushdown
*/
static struct sockaddr sun_noname = { sizeof(sun_noname), AF_LOCAL };
static const struct sockaddr sun_noname = { sizeof(sun_noname), AF_LOCAL };
static ino_t unp_ino; /* prototype for fake inode numbers */
static int unp_attach(struct socket *);
@ -127,7 +127,7 @@ uipc_accept(struct socket *so, struct sockaddr **nam)
*nam = sodupsockaddr(
(struct sockaddr *)unp->unp_conn->unp_addr, M_WAITOK);
} else {
*nam = sodupsockaddr((struct sockaddr *)&sun_noname,
*nam = sodupsockaddr((const struct sockaddr *)&sun_noname,
M_WAITOK);
}
return (0);
@ -226,7 +226,7 @@ uipc_peeraddr(struct socket *so, struct sockaddr **nam)
* connection is established. So, this else clause is
* added as workaround to return PF_LOCAL sockaddr.
*/
*nam = sodupsockaddr((struct sockaddr *)&sun_noname,
*nam = sodupsockaddr((const struct sockaddr *)&sun_noname,
M_WAITOK);
}
return (0);
@ -296,7 +296,7 @@ uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
switch (so->so_type) {
case SOCK_DGRAM:
{
struct sockaddr *from;
const struct sockaddr *from;
if (nam != NULL) {
if (unp->unp_conn != NULL) {
@ -443,7 +443,7 @@ uipc_sockaddr(struct socket *so, struct sockaddr **nam)
*nam = sodupsockaddr((struct sockaddr *)unp->unp_addr,
M_WAITOK);
else
*nam = sodupsockaddr((struct sockaddr *)&sun_noname,
*nam = sodupsockaddr((const struct sockaddr *)&sun_noname,
M_WAITOK);
return (0);
}

View File

@ -364,7 +364,7 @@ int sockargs(struct mbuf **mp, caddr_t buf, int buflen, int type);
int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len);
void sbappend(struct sockbuf *sb, struct mbuf *m);
void sbappendstream(struct sockbuf *sb, struct mbuf *m);
int sbappendaddr(struct sockbuf *sb, struct sockaddr *asa,
int sbappendaddr(struct sockbuf *sb, const struct sockaddr *asa,
struct mbuf *m0, struct mbuf *control);
int sbappendcontrol(struct sockbuf *sb, struct mbuf *m0,
struct mbuf *control);