From b2e0866d3715193b0c977023837a02259a3a8086 Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Fri, 22 Jul 2016 11:14:42 +0000 Subject: Revert in_selectsrc() refactoring, it breaks IPv6. Reported by Heiko on bugs@. ok stsp@, claudio@ --- sys/netinet/in_pcb.c | 15 ++++++--------- sys/netinet/in_pcb.h | 5 +++-- sys/netinet/udp_usrreq.c | 5 +++-- 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'sys/netinet') diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index d25c04d2293..ecdd24f21bf 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.211 2016/07/20 18:51:50 vgross Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.212 2016/07/22 11:14:41 mpi Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -525,7 +525,8 @@ in_pcbconnect(struct inpcb *inp, struct mbuf *nam) if (sin->sin_port == 0) return (EADDRNOTAVAIL); - error = in_pcbselsrc(&ina, sin, inp); + error = in_selectsrc(&ina, sin, inp->inp_moptions, &inp->inp_route, + &inp->inp_laddr, inp->inp_rtableid); if (error) return (error); @@ -875,14 +876,10 @@ in_pcbrtentry(struct inpcb *inp) * an entry to the caller for later use. */ int -in_pcbselsrc(struct in_addr **insrc, struct sockaddr_in *sin, - struct inpcb *inp) +in_selectsrc(struct in_addr **insrc, struct sockaddr_in *sin, + struct ip_moptions *mopts, struct route *ro, struct in_addr *laddr, + u_int rtableid) { - struct ip_moptions *mopts = inp->inp_moptions; - struct route *ro = &inp->inp_route; - struct in_addr *laddr = &inp->inp_laddr; - u_int rtableid = inp->inp_rtableid; - struct sockaddr_in *sin2; struct in_ifaddr *ia = NULL; diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 0a67d11746d..756cb6f159a 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.h,v 1.101 2016/07/20 18:51:50 vgross Exp $ */ +/* $OpenBSD: in_pcb.h,v 1.102 2016/07/22 11:14:41 mpi Exp $ */ /* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */ /* @@ -289,7 +289,8 @@ void in_setpeeraddr(struct inpcb *, struct mbuf *); void in_setsockaddr(struct inpcb *, struct mbuf *); int in_baddynamic(u_int16_t, u_int16_t); int in_rootonly(u_int16_t, u_int16_t); -int in_pcbselsrc(struct in_addr **, struct sockaddr_in *, struct inpcb *); +int in_selectsrc(struct in_addr **, struct sockaddr_in *, + struct ip_moptions *, struct route *, struct in_addr *, u_int); struct rtentry * in_pcbrtentry(struct inpcb *); diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index f8cd2c950f2..c8559de7a88 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.215 2016/07/20 18:51:50 vgross Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.216 2016/07/22 11:14:41 mpi Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -989,7 +989,8 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct mbuf *addr, goto release; } - error = in_pcbselsrc(&laddr, sin, inp); + error = in_selectsrc(&laddr, sin, inp->inp_moptions, + &inp->inp_route, &inp->inp_laddr, inp->inp_rtableid); if (error) goto release; -- cgit v1.2.3