mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
- Remove redundant call to pr_ctloutput from code that handles SO_SETFIB.
- Add a check for errors during copyin while here. Reviewed by: julian, bz MFC after: 2 weeks
This commit is contained in:
parent
79f6687df0
commit
60a305887a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=233850
@ -2504,20 +2504,19 @@ sosetopt(struct socket *so, struct sockopt *sopt)
|
||||
case SO_SETFIB:
|
||||
error = sooptcopyin(sopt, &optval, sizeof optval,
|
||||
sizeof optval);
|
||||
if (error)
|
||||
goto bad;
|
||||
|
||||
if (optval < 0 || optval >= rt_numfibs) {
|
||||
error = EINVAL;
|
||||
goto bad;
|
||||
}
|
||||
if (((so->so_proto->pr_domain->dom_family == PF_INET) ||
|
||||
(so->so_proto->pr_domain->dom_family == PF_INET6) ||
|
||||
(so->so_proto->pr_domain->dom_family == PF_ROUTE))) {
|
||||
(so->so_proto->pr_domain->dom_family == PF_ROUTE)))
|
||||
so->so_fibnum = optval;
|
||||
/* Note: ignore error */
|
||||
if (so->so_proto->pr_ctloutput)
|
||||
(*so->so_proto->pr_ctloutput)(so, sopt);
|
||||
} else {
|
||||
else
|
||||
so->so_fibnum = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case SO_USER_COOKIE:
|
||||
|
Loading…
Reference in New Issue
Block a user