summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@cvs.openbsd.org>2016-12-13 09:22:19 +0000
committerRafael Zalamena <rzalamena@cvs.openbsd.org>2016-12-13 09:22:19 +0000
commit4674638078d46a0a16a93a6af6479c8a741f213e (patch)
tree26da10d159385e0a5fe8093fd75c3345fb65741c /sys
parente974f08e9b0519ecb035b6ed5b466a26b05c7231 (diff)
Propagate the routing table id in ip_mrouter_set() so the MRT_ADD_VIF
calls won't fail anymore when doing from a different rdomain. ok mpi@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_mroute.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 593a6395199..ffdb7856493 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_mroute.c,v 1.93 2016/11/29 15:52:12 mpi Exp $ */
+/* $OpenBSD: ip_mroute.c,v 1.94 2016/12/13 09:22:18 rzalamena Exp $ */
/* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */
/*
@@ -130,7 +130,7 @@ int get_vif_cnt(struct sioc_vif_req *);
int get_vif_ctl(struct vifctl *);
int ip_mrouter_init(struct socket *, struct mbuf *);
int get_version(struct mbuf *);
-int add_vif(struct mbuf *);
+int add_vif(struct socket *, struct mbuf *);
int del_vif(struct mbuf *);
void update_mfc_params(struct mfc *, struct mfcctl2 *);
void init_mfc_params(struct mfc *, struct mfcctl2 *);
@@ -293,7 +293,7 @@ ip_mrouter_set(struct socket *so, int optname, struct mbuf **mp)
error = ip_mrouter_done();
break;
case MRT_ADD_VIF:
- error = add_vif(*mp);
+ error = add_vif(so, *mp);
break;
case MRT_DEL_VIF:
error = del_vif(*mp);
@@ -773,8 +773,9 @@ static struct sockaddr_in sin = { sizeof(sin), AF_INET };
* Add a vif to the vif table
*/
int
-add_vif(struct mbuf *m)
+add_vif(struct socket *so, struct mbuf *m)
{
+ struct inpcb *inp;
struct vifctl *vifcp;
struct vif *vifp;
struct ifaddr *ifa;
@@ -809,8 +810,9 @@ add_vif(struct mbuf *m)
} else
#endif
{
+ inp = sotoinpcb(so);
sin.sin_addr = vifcp->vifc_lcl_addr;
- ifa = ifa_ifwithaddr(sintosa(&sin), /* XXX */ 0);
+ ifa = ifa_ifwithaddr(sintosa(&sin), inp->inp_rtableid);
if (ifa == NULL)
return (EADDRNOTAVAIL);
}