From f3ab94f7b4b8a27fb80347158315e4588b95047b Mon Sep 17 00:00:00 2001 From: bz Date: Sat, 24 May 2008 15:20:48 +0000 Subject: 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 --- sys/netinet/udp_usrreq.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'sys/netinet/udp_usrreq.c') 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); } -- cgit v1.1