For consistency with prison_{local,remote,check}_ipN rename
prison_getipN to prison_get_ipN. Submitted by: jamie (as part of a larger patch) MFC after: 1 week
This commit is contained in:
parent
8d456252aa
commit
1cecba0fcd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187684
@ -812,7 +812,7 @@ prison_proc_free(struct prison *pr)
|
||||
* Returns 0 on success, 1 on error. Address returned in NBO.
|
||||
*/
|
||||
int
|
||||
prison_getip4(struct ucred *cred, struct in_addr *ia)
|
||||
prison_get_ip4(struct ucred *cred, struct in_addr *ia)
|
||||
{
|
||||
|
||||
KASSERT(cred != NULL, ("%s: cred is NULL", __func__));
|
||||
@ -958,7 +958,7 @@ prison_check_ip4(struct ucred *cred, struct in_addr *ia)
|
||||
* Returns 0 on success, 1 on error.
|
||||
*/
|
||||
int
|
||||
prison_getip6(struct ucred *cred, struct in6_addr *ia6)
|
||||
prison_get_ip6(struct ucred *cred, struct in6_addr *ia6)
|
||||
{
|
||||
|
||||
KASSERT(cred != NULL, ("%s: cred is NULL", __func__));
|
||||
|
@ -376,7 +376,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
|
||||
* 3. As a last resort return the 'default'
|
||||
* jail address.
|
||||
*/
|
||||
if (prison_getip4(cred, &ia) != 0)
|
||||
if (prison_get_ip4(cred, &ia) != 0)
|
||||
return (ESRCH);
|
||||
}
|
||||
bzero(&saun->sin, sizeof(struct sockaddr_in));
|
||||
@ -428,7 +428,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
|
||||
* 3. As a last resort return the 'default'
|
||||
* jail address.
|
||||
*/
|
||||
if (prison_getip6(cred, &ia6) != 0)
|
||||
if (prison_get_ip6(cred, &ia6) != 0)
|
||||
return (ESRCH);
|
||||
}
|
||||
bzero(&saun->sin6, sizeof(struct sockaddr_in6));
|
||||
|
@ -625,7 +625,7 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr,
|
||||
}
|
||||
|
||||
/* 3. As a last resort return the 'default' jail address. */
|
||||
if (prison_getip4(cred, laddr) != 0)
|
||||
if (prison_get_ip4(cred, laddr) != 0)
|
||||
error = EADDRNOTAVAIL;
|
||||
goto done;
|
||||
}
|
||||
@ -678,7 +678,7 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr,
|
||||
}
|
||||
|
||||
/* 3. As a last resort return the 'default' jail address. */
|
||||
if (prison_getip4(cred, laddr) != 0)
|
||||
if (prison_get_ip4(cred, laddr) != 0)
|
||||
error = EADDRNOTAVAIL;
|
||||
goto done;
|
||||
}
|
||||
@ -741,7 +741,7 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr,
|
||||
}
|
||||
|
||||
/* 3. As a last resort return the 'default' jail address. */
|
||||
if (prison_getip4(cred, laddr) != 0)
|
||||
if (prison_get_ip4(cred, laddr) != 0)
|
||||
error = EADDRNOTAVAIL;
|
||||
goto done;
|
||||
}
|
||||
@ -810,7 +810,7 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr *nam,
|
||||
*/
|
||||
if (faddr.s_addr == INADDR_ANY) {
|
||||
if (cred != NULL && jailed(cred)) {
|
||||
if (prison_getip4(cred, &jailia) != 0)
|
||||
if (prison_get_ip4(cred, &jailia) != 0)
|
||||
return (EADDRNOTAVAIL);
|
||||
faddr.s_addr = jailia.s_addr;
|
||||
} else {
|
||||
|
@ -371,7 +371,7 @@ rip_output(struct mbuf *m, struct socket *so, u_long dst)
|
||||
ip->ip_p = inp->inp_ip_p;
|
||||
ip->ip_len = m->m_pkthdr.len;
|
||||
if (jailed(inp->inp_cred)) {
|
||||
if (prison_getip4(inp->inp_cred, &ip->ip_src)) {
|
||||
if (prison_get_ip4(inp->inp_cred, &ip->ip_src) != 0) {
|
||||
INP_RUNLOCK(inp);
|
||||
m_freem(m);
|
||||
return (EPERM);
|
||||
|
@ -412,7 +412,7 @@ rip6_output(m, va_alist)
|
||||
goto bad;
|
||||
}
|
||||
if (jailed(in6p->inp_cred))
|
||||
if (prison_getip6(in6p->inp_cred, in6a) != 0) {
|
||||
if (prison_get_ip6(in6p->inp_cred, in6a) != 0) {
|
||||
error = EPERM;
|
||||
goto bad;
|
||||
}
|
||||
|
@ -181,12 +181,12 @@ void prison_hold(struct prison *pr);
|
||||
void prison_hold_locked(struct prison *pr);
|
||||
void prison_proc_hold(struct prison *);
|
||||
void prison_proc_free(struct prison *);
|
||||
int prison_getip4(struct ucred *cred, struct in_addr *ia);
|
||||
int prison_get_ip4(struct ucred *cred, struct in_addr *ia);
|
||||
int prison_local_ip4(struct ucred *cred, struct in_addr *ia);
|
||||
int prison_remote_ip4(struct ucred *cred, struct in_addr *ia);
|
||||
int prison_check_ip4(struct ucred *cred, struct in_addr *ia);
|
||||
#ifdef INET6
|
||||
int prison_getip6(struct ucred *, struct in6_addr *);
|
||||
int prison_get_ip6(struct ucred *, struct in6_addr *);
|
||||
int prison_local_ip6(struct ucred *, struct in6_addr *, int);
|
||||
int prison_remote_ip6(struct ucred *, struct in6_addr *);
|
||||
int prison_check_ip6(struct ucred *, struct in6_addr *);
|
||||
|
Loading…
Reference in New Issue
Block a user