summaryrefslogtreecommitdiffstats
path: root/sys/netinet/raw_ip.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2005-09-26 20:25:16 +0000
committerandre <andre@FreeBSD.org>2005-09-26 20:25:16 +0000
commitbedcd4ace8e6c1ce8c4308a2e5dd2e0a92d9ac06 (patch)
treea3737bbb5bd709abc559f3b94c77fac68eb192c2 /sys/netinet/raw_ip.c
parent4eeb530ac72e50536d9d5f48d9cba224a2f48e77 (diff)
downloadFreeBSD-src-bedcd4ace8e6c1ce8c4308a2e5dd2e0a92d9ac06.zip
FreeBSD-src-bedcd4ace8e6c1ce8c4308a2e5dd2e0a92d9ac06.tar.gz
Implement IP_DONTFRAG IP socket option enabling the Don't Fragment
flag on IP packets. Currently this option is only repected on udp and raw ip sockets. On tcp sockets the DF flag is controlled by the path MTU discovery option. Sending a packet larger than the MTU size of the egress interface returns an EMSGSIZE error. Discussed with: rwatson Sponsored by: TCP/IP Optimization Fundraise 2005
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r--sys/netinet/raw_ip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 8a128eb..bc250a4 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -271,7 +271,10 @@ rip_output(struct mbuf *m, struct socket *so, u_long dst)
INP_LOCK(inp);
ip = mtod(m, struct ip *);
ip->ip_tos = inp->inp_ip_tos;
- ip->ip_off = 0;
+ if (inp->inp_flags & INP_DONTFRAG)
+ ip->ip_off = IP_DF;
+ else
+ ip->ip_off = 0;
ip->ip_p = inp->inp_ip_p;
ip->ip_len = m->m_pkthdr.len;
if (jailed(inp->inp_socket->so_cred))
OpenPOWER on IntegriCloud