diff options
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 9700554b3ab..486b8d176e0 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.238 2017/06/26 09:32:32 mpi Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.239 2017/08/11 19:53:02 bluhm Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -960,26 +960,16 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct mbuf *addr, } if (addr) { - sin = mtod(addr, struct sockaddr_in *); - - if (addr->m_len != sizeof(*sin)) { - error = EINVAL; - goto release; - } - if (sin->sin_family != AF_INET) { - error = EAFNOSUPPORT; + if ((error = in_nam2sin(addr, &sin))) goto release; - } if (sin->sin_port == 0) { error = EADDRNOTAVAIL; goto release; } - if (inp->inp_faddr.s_addr != INADDR_ANY) { error = EISCONN; goto release; } - error = in_pcbselsrc(&laddr, sin, inp); if (error) goto release; |