summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-05-24 15:20:48 +0000
committerbz <bz@FreeBSD.org>2008-05-24 15:20:48 +0000
commitf3ab94f7b4b8a27fb80347158315e4588b95047b (patch)
treedc7480503f403e2e1d1ab9b9601f47bc330744f3 /sys/netinet/udp_usrreq.c
parent0bf5a314d88ca0c5df2f71ef6beb6bc4067223f5 (diff)
downloadFreeBSD-src-f3ab94f7b4b8a27fb80347158315e4588b95047b.zip
FreeBSD-src-f3ab94f7b4b8a27fb80347158315e4588b95047b.tar.gz
Factor out the v4-only vs. the v6-only inp_flags processing in
ip6_savecontrol in preparation for udp_append() to no longer need an WLOCK as we will no longer be modifying socket options. Requested by: rwatson Reviewed by: gnn MFC after: 10 days
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index d765899..bb40129 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -214,14 +214,9 @@ udp_append(struct inpcb *inp, struct ip *ip, struct mbuf *n, int off,
if (inp->inp_flags & INP_CONTROLOPTS ||
inp->inp_socket->so_options & (SO_TIMESTAMP | SO_BINTIME)) {
#ifdef INET6
- if (inp->inp_vflag & INP_IPV6) {
- int savedflags;
-
- savedflags = inp->inp_flags;
- inp->inp_flags &= ~INP_UNMAPPABLEOPTS;
- ip6_savecontrol(inp, n, &opts);
- inp->inp_flags = savedflags;
- } else
+ if (inp->inp_vflag & INP_IPV6)
+ ip6_savecontrol_v4(inp, n, &opts);
+ else
#endif
ip_savecontrol(inp, &opts, ip, n);
}
OpenPOWER on IntegriCloud