From 773b573a9616b08f2a035a49bc7569187890268a Mon Sep 17 00:00:00 2001 From: Kip Macy Date: Wed, 15 Apr 2009 22:09:42 +0000 Subject: [PATCH] - add second flags field to to inpcb - update comments in vflag --- UPDATING | 5 +++++ sys/netinet/in_pcb.h | 11 +++++++---- sys/sys/param.h | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/UPDATING b/UPDATING index a3493333f3a2..00b6d03b517b 100644 --- a/UPDATING +++ b/UPDATING @@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW: to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090415: + Anticipate overflowing inp_flags - add inp_flags2. + This changes most offsets in inpcb, so checking v4 connection + state will require a world rebuild. + Bump __FreeBSD_version to 800080. 20090415: Add an llentry to struct route and struct route_in6. Modules embedding a struct route will need to be recompiled. diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index f2bcde3dbba2..38fd46a9000f 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -163,6 +163,7 @@ struct inpcb { struct ucred *inp_cred; /* (c) cache of socket cred */ u_int32_t inp_flow; /* (i) IPv6 flow information */ int inp_flags; /* (i) generic IP/datagram flags */ + int inp_flags2; /* (i) generic IP/datagram flags #2*/ u_char inp_vflag; /* (i) IP version flag (v4/v6) */ u_char inp_ip_ttl; /* (i) time to live proto */ u_char inp_ip_p; /* (c) protocol proto */ @@ -380,16 +381,14 @@ void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, (ntohs((lport)) & (mask)) /* - * Flags for inp_vflags -- historically version flags only, but now quite a - * bit more due to an overflow of inp_flag, leading to some locking ambiguity - * as some bits are stable from initial allocation, and others may change. + * Flags for inp_vflags -- historically version flags only */ #define INP_IPV4 0x1 #define INP_IPV6 0x2 #define INP_IPV6PROTO 0x4 /* opened under IPv6 protocol */ /* - * Flags for inp_flag. + * Flags for inp_flags. */ #define INP_RECVOPTS 0x00000001 /* receive incoming IP options */ #define INP_RECVRETOPTS 0x00000002 /* receive IP options for reply */ @@ -431,6 +430,10 @@ void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, IN6P_TCLASS|IN6P_AUTOFLOWLABEL|IN6P_RFC2292|\ IN6P_MTU) +/* + * Flags for inp_flags2. + */ + #define INPLOOKUP_WILDCARD 1 #define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb) #define sotoin6pcb(so) sotoinpcb(so) /* for KAME src sync over BSD*'s */ diff --git a/sys/sys/param.h b/sys/sys/param.h index 1220c7bd7076..a6edd6cf960e 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800079 /* Master, propagated to newvers */ +#define __FreeBSD_version 800080 /* Master, propagated to newvers */ #ifndef LOCORE #include