Index: ip_output.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_output.c,v retrieving revision 1.242.2.9 diff -u -r1.242.2.9 ip_output.c --- ip_output.c 4 Jun 2006 10:19:34 -0000 1.242.2.9 +++ ip_output.c 28 Jun 2006 09:03:14 -0000 @@ -1154,7 +1154,7 @@ struct socket *so; struct sockopt *sopt; { - struct inpcb *inp = sotoinpcb(so); + struct inpcb *inp; int error, optval; error = optval = 0; @@ -1187,6 +1187,7 @@ m_free(m); break; } + inp = sotoinpcb(so); INP_LOCK(inp); error = ip_pcbopts(inp, sopt->sopt_name, m); INP_UNLOCK(inp); @@ -1209,6 +1210,7 @@ if (error) break; + inp = sotoinpcb(so); switch (sopt->sopt_name) { case IP_TOS: inp->inp_ip_tos = optval; @@ -1274,6 +1276,7 @@ case IP_MULTICAST_LOOP: case IP_ADD_MEMBERSHIP: case IP_DROP_MEMBERSHIP: + inp = sotoinpcb(so); error = ip_setmoptions(inp, sopt); break; @@ -1283,6 +1286,7 @@ if (error) break; + inp = sotoinpcb(so); INP_LOCK(inp); switch (optval) { case IP_PORTRANGE_DEFAULT: @@ -1325,6 +1329,7 @@ req = mtod(m, caddr_t); len = m->m_len; optname = sopt->sopt_name; + inp = sotoinpcb(so); error = ipsec4_set_policy(inp, optname, req, len, priv); m_freem(m); break; @@ -1341,6 +1346,7 @@ switch (sopt->sopt_name) { case IP_OPTIONS: case IP_RETOPTS: + inp = sotoinpcb(so); if (inp->inp_options) error = sooptcopyout(sopt, mtod(inp->inp_options, @@ -1362,6 +1368,7 @@ case IP_FAITH: case IP_ONESBCAST: case IP_DONTFRAG: + inp = sotoinpcb(so); switch (sopt->sopt_name) { case IP_TOS: @@ -1427,6 +1434,7 @@ case IP_MULTICAST_LOOP: case IP_ADD_MEMBERSHIP: case IP_DROP_MEMBERSHIP: + inp = sotoinpcb(so); error = ip_getmoptions(inp, sopt); break; @@ -1441,7 +1449,8 @@ req = mtod(m, caddr_t); len = m->m_len; } - error = ipsec4_get_policy(sotoinpcb(so), req, len, &m); + inp = sotoinpcb(so); + error = ipsec4_get_policy(inp, req, len, &m); if (error == 0) error = soopt_mcopyout(sopt, m); /* XXX */ if (error == 0)