mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
Allow the SO_SETFIB socket option to select the default (0)
routing table. Reviewed by: julian
This commit is contained in:
parent
e9749129ad
commit
f7e6ce6d7a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=218627
@ -2449,15 +2449,16 @@ sosetopt(struct socket *so, struct sockopt *sopt)
|
||||
case SO_SETFIB:
|
||||
error = sooptcopyin(sopt, &optval, sizeof optval,
|
||||
sizeof optval);
|
||||
if (optval < 1 || optval > rt_numfibs) {
|
||||
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_ROUTE)) {
|
||||
if (so->so_proto != NULL &&
|
||||
((so->so_proto->pr_domain->dom_family == PF_INET) ||
|
||||
(so->so_proto->pr_domain->dom_family == PF_ROUTE))) {
|
||||
so->so_fibnum = optval;
|
||||
/* Note: ignore error */
|
||||
if (so->so_proto && so->so_proto->pr_ctloutput)
|
||||
if (so->so_proto->pr_ctloutput)
|
||||
(*so->so_proto->pr_ctloutput)(so, sopt);
|
||||
} else {
|
||||
so->so_fibnum = 0;
|
||||
|
@ -486,6 +486,10 @@ udp_input(struct mbuf *m, int off)
|
||||
INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
if (imo == NULL) {
|
||||
INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
bzero(&group, sizeof(struct sockaddr_in));
|
||||
group.sin_len = sizeof(struct sockaddr_in);
|
||||
group.sin_family = AF_INET;
|
||||
|
Loading…
Reference in New Issue
Block a user