svn commit: r186141 - in head/sys: netinet netinet6 netipsec

2008-12-15 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Dec 15 21:50:54 2008
New Revision: 186141
URL: http://svn.freebsd.org/changeset/base/186141

Log:
  Another step assimilating IPv[46] PCB code - directly use
  the inpcb names rather than the following IPv6 compat macros:
  in6pcb,in6p_sp, in6p_ip6_nxt,in6p_flowinfo,in6p_vflag,
  in6p_flags,in6p_socket,in6p_lport,in6p_fport,in6p_ppcb and
  sotoin6pcb().
  
  Apart from removing duplicate code in netipsec, this is a pure
  whitespace, not a functional change.
  
  Discussed with:   rwatson
  Reviewed by:  rwatson (version before review requested changes)
  MFC after:4 weeks (set the timer and see then)

Modified:
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_syncache.c
  head/sys/netinet/tcp_usrreq.c
  head/sys/netinet6/icmp6.c
  head/sys/netinet6/in6_pcb.c
  head/sys/netinet6/in6_src.c
  head/sys/netinet6/ip6_input.c
  head/sys/netinet6/ip6_output.c
  head/sys/netinet6/raw_ip6.c
  head/sys/netinet6/udp6_usrreq.c
  head/sys/netipsec/ipsec.c
  head/sys/netipsec/key.c

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Mon Dec 15 21:42:38 2008(r186140)
+++ head/sys/netinet/tcp_subr.c Mon Dec 15 21:50:54 2008(r186141)
@@ -434,7 +434,7 @@ tcpip_fillheaders(struct inpcb *inp, voi
 
ip6 = (struct ip6_hdr *)ip_ptr;
ip6-ip6_flow = (ip6-ip6_flow  ~IPV6_FLOWINFO_MASK) |
-   (inp-in6p_flowinfo  IPV6_FLOWINFO_MASK);
+   (inp-inp_flow  IPV6_FLOWINFO_MASK);
ip6-ip6_vfc = (ip6-ip6_vfc  ~IPV6_VERSION_MASK) |
(IPV6_VERSION  IPV6_VERSION_MASK);
ip6-ip6_nxt = IPPROTO_TCP;

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Mon Dec 15 21:42:38 2008
(r186140)
+++ head/sys/netinet/tcp_syncache.c Mon Dec 15 21:50:54 2008
(r186141)
@@ -708,8 +708,8 @@ syncache_socket(struct syncache *sc, str
goto abort;
}
/* Override flowlabel from in6_pcbconnect. */
-   inp-in6p_flowinfo = ~IPV6_FLOWLABEL_MASK;
-   inp-in6p_flowinfo |= sc-sc_flowlabel;
+   inp-inp_flow = ~IPV6_FLOWLABEL_MASK;
+   inp-inp_flow |= sc-sc_flowlabel;
} else
 #endif
{
@@ -994,7 +994,7 @@ _syncache_add(struct in_conninfo *inc, s
 
 #ifdef INET6
if (inc-inc_isipv6 
-   (inp-in6p_flags  IN6P_AUTOFLOWLABEL))
+   (inp-inp_flags  IN6P_AUTOFLOWLABEL))
autoflowlabel = 1;
 #endif
ip_ttl = inp-inp_ip_ttl;
@@ -1654,7 +1654,7 @@ syncookie_lookup(struct in_conninfo *inc
 
 #ifdef INET6
if (inc-inc_isipv6) {
-   if (sotoinpcb(so)-in6p_flags  IN6P_AUTOFLOWLABEL)
+   if (sotoinpcb(so)-inp_flags  IN6P_AUTOFLOWLABEL)
sc-sc_flowlabel = md5_buffer[1]  IPV6_FLOWLABEL_MASK;
} else
 #endif

Modified: head/sys/netinet/tcp_usrreq.c
==
--- head/sys/netinet/tcp_usrreq.c   Mon Dec 15 21:42:38 2008
(r186140)
+++ head/sys/netinet/tcp_usrreq.c   Mon Dec 15 21:50:54 2008
(r186141)
@@ -1167,9 +1167,9 @@ tcp6_connect(struct tcpcb *tp, struct so
inp-in6p_faddr = sin6-sin6_addr;
inp-inp_fport = sin6-sin6_port;
/* update flowinfo - draft-itojun-ipv6-flowlabel-api-00 */
-   inp-in6p_flowinfo = ~IPV6_FLOWLABEL_MASK;
-   if (inp-in6p_flags  IN6P_AUTOFLOWLABEL)
-   inp-in6p_flowinfo |=
+   inp-inp_flow = ~IPV6_FLOWLABEL_MASK;
+   if (inp-inp_flags  IN6P_AUTOFLOWLABEL)
+   inp-inp_flow |=
(htonl(ip6_randomflowlabel())  IPV6_FLOWLABEL_MASK);
in_pcbrehash(inp);
 

Modified: head/sys/netinet6/icmp6.c
==
--- head/sys/netinet6/icmp6.c   Mon Dec 15 21:42:38 2008(r186140)
+++ head/sys/netinet6/icmp6.c   Mon Dec 15 21:50:54 2008(r186141)
@@ -1899,8 +1899,8 @@ icmp6_rip6_input(struct mbuf **mp, int o
INIT_VNET_INET6(curvnet);
struct mbuf *m = *mp;
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
-   struct in6pcb *in6p;
-   struct in6pcb *last = NULL;
+   struct inpcb *in6p;
+   struct inpcb *last = NULL;
struct sockaddr_in6 fromsa;
struct icmp6_hdr *icmp6;
struct mbuf *opts = NULL;
@@ -1933,7 +1933,7 @@ icmp6_rip6_input(struct mbuf **mp, int o
LIST_FOREACH(in6p, V_ripcb, inp_list) {
if ((in6p-inp_vflag  INP_IPV6) == 0)
continue;
-   if (in6p-in6p_ip6_nxt != IPPROTO_ICMPV6)
+   if (in6p-inp_ip_p != IPPROTO_ICMPV6)
continue;
if 

Re: svn commit: r186141 - in head/sys: netinet netinet6 netipsec

2008-12-15 Thread Bjoern A. Zeeb

On Mon, 15 Dec 2008, Bjoern A. Zeeb wrote:

Hi,


Author: bz
Date: Mon Dec 15 21:50:54 2008
New Revision: 186141
URL: http://svn.freebsd.org/changeset/base/186141

Log:
 Another step assimilating IPv[46] PCB code - directly use
 the inpcb names rather than the following IPv6 compat macros:
 in6pcb,in6p_sp, in6p_ip6_nxt,in6p_flowinfo,in6p_vflag,
 in6p_flags,in6p_socket,in6p_lport,in6p_fport,in6p_ppcb and
 sotoin6pcb().


This is going to be the first in a series of smaller commits over the
next days.

Once we are (I am) through with the (whitespace) assimilation we might
be more agressive on code and some inpcb fields, either removing or
possibly renaming them.

Note: the macros are going to stay for compat and 3rd party reasons,
  etc.  (at least for another while).
Note: SCTP was deliberately ignored and left out from the changes.


/bz

--
Bjoern A. Zeeb  The greatest risk is not taking one.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org