diff options
| author | Steven Hartland <smh@FreeBSD.org> | 2014-04-24 12:52:31 +0000 |
|---|---|---|
| committer | Steven Hartland <smh@FreeBSD.org> | 2014-04-24 12:52:31 +0000 |
| commit | ae19083248ad6d932f1636b743a64a319e31235d (patch) | |
| tree | dd01fe6bd6b71e04638499792c1c2e768f9d0f55 /sys/netinet/raw_ip.c | |
| parent | 802d215dc1cc555ad11c6a03a4e1147dcff0d0fa (diff) | |
Notes
Diffstat (limited to 'sys/netinet/raw_ip.c')
| -rw-r--r-- | sys/netinet/raw_ip.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 84fec9a7ab230..83c8f480f189c 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -454,26 +454,26 @@ rip_output(struct mbuf *m, struct socket *so, u_long dst) ip->ip_p = inp->inp_ip_p; ip->ip_len = htons(m->m_pkthdr.len); ip->ip_src = inp->inp_laddr; + ip->ip_dst.s_addr = dst; if (jailed(inp->inp_cred)) { /* * prison_local_ip4() would be good enough but would * let a source of INADDR_ANY pass, which we do not - * want to see from jails. We do not go through the - * pain of in_pcbladdr() for raw sockets. + * want to see from jails. */ - if (ip->ip_src.s_addr == INADDR_ANY) - error = prison_get_ip4(inp->inp_cred, - &ip->ip_src); - else + if (ip->ip_src.s_addr == INADDR_ANY) { + error = in_pcbladdr(inp, &ip->ip_dst, &ip->ip_src, + inp->inp_cred); + } else { error = prison_local_ip4(inp->inp_cred, &ip->ip_src); + } if (error != 0) { INP_RUNLOCK(inp); m_freem(m); return (error); } } - ip->ip_dst.s_addr = dst; ip->ip_ttl = inp->inp_ip_ttl; } else { if (m->m_pkthdr.len > IP_MAXPACKET) { |
