svn commit: r200123 - stable/7/sys/netinet

Luigi Rizzo luigi at FreeBSD.org
Sat Dec 5 13:53:42 UTC 2009


Author: luigi
Date: Sat Dec  5 13:53:41 2009
New Revision: 200123
URL: http://svn.freebsd.org/changeset/base/200123

Log:
  some MFC:
  r200020
    change the type of the opcode from enum *:8  to u_int8_t
    so the size and alignment of the ipfw_insn is not compiler dependent.
    No changes in the code generated by gcc.
  
  r200023
    Add new sockopt names for ipfw and dummynet.
  
    This commit is just grabbing entries for the new names
    that will be used in the future, so you don't need to
    rebuild anything now.
  
  r200034
    Dispatch sockopt calls to ipfw and dummynet
    using the new option numbers, IP_FW3 and IP_DUMMYNET3.
    Right now the modules return an error if called with those arguments
    so there is no danger of unwanted behaviour.
  
  The code for r200040 was already in RELENG_7 before the 8.x freeze

Modified:
  stable/7/sys/netinet/in.h
  stable/7/sys/netinet/ip_fw.h
  stable/7/sys/netinet/raw_ip.c

Modified: stable/7/sys/netinet/in.h
==============================================================================
--- stable/7/sys/netinet/in.h	Sat Dec  5 13:45:21 2009	(r200122)
+++ stable/7/sys/netinet/in.h	Sat Dec  5 13:53:41 2009	(r200123)
@@ -438,12 +438,20 @@ __END_DECLS
 
 #define	IP_ONESBCAST		23   /* bool: send all-ones broadcast */
 
+/*
+ * Options for controlling the firewall and dummynet.
+ * Historical options (from 40 to 64) will eventually be
+ * replaced by only two options, IP_FW3 and IP_DUMMYNET3.
+ */
 #define	IP_FW_TABLE_ADD		40   /* add entry */
 #define	IP_FW_TABLE_DEL		41   /* delete entry */
 #define	IP_FW_TABLE_FLUSH	42   /* flush table */
 #define	IP_FW_TABLE_GETSIZE	43   /* get table size */
 #define	IP_FW_TABLE_LIST	44   /* list table contents */
 
+#define	IP_FW3			48   /* generic ipfw v.3 sockopts */
+#define	IP_DUMMYNET3		49   /* generic dummynet v.3 sockopts */
+
 #define	IP_FW_ADD		50   /* add a firewall rule to chain */
 #define	IP_FW_DEL		51   /* delete a firewall rule from chain */
 #define	IP_FW_FLUSH		52   /* flush firewall rule chain */

Modified: stable/7/sys/netinet/ip_fw.h
==============================================================================
--- stable/7/sys/netinet/ip_fw.h	Sat Dec  5 13:45:21 2009	(r200122)
+++ stable/7/sys/netinet/ip_fw.h	Sat Dec  5 13:53:41 2009	(r200123)
@@ -216,7 +216,7 @@ enum ipfw_opcodes {		/* arguments (4 byt
  *
  */
 typedef struct	_ipfw_insn {	/* template for instructions */
-	enum ipfw_opcodes	opcode:8;
+	u_int8_t	opcode;
 	u_int8_t	len;	/* number of 32-bit words */
 #define	F_NOT		0x80
 #define	F_OR		0x40

Modified: stable/7/sys/netinet/raw_ip.c
==============================================================================
--- stable/7/sys/netinet/raw_ip.c	Sat Dec  5 13:45:21 2009	(r200122)
+++ stable/7/sys/netinet/raw_ip.c	Sat Dec  5 13:53:41 2009	(r200123)
@@ -453,6 +453,7 @@ rip_ctloutput(struct socket *so, struct 
 			error = sooptcopyout(sopt, &optval, sizeof optval);
 			break;
 
+		case IP_FW3:	/* generic ipfw v.3 functions */
 		case IP_FW_ADD:	/* ADD actually returns the body... */
 		case IP_FW_GET:
 		case IP_FW_TABLE_GETSIZE:
@@ -465,6 +466,7 @@ rip_ctloutput(struct socket *so, struct 
 				error = ENOPROTOOPT;
 			break;
 
+		case IP_DUMMYNET3:	/* generic dummynet v.3 functions */
 		case IP_DUMMYNET_GET:
 			if (ip_dn_ctl_ptr != NULL)
 				error = ip_dn_ctl_ptr(sopt);
@@ -510,6 +512,7 @@ rip_ctloutput(struct socket *so, struct 
 				inp->inp_flags &= ~INP_HDRINCL;
 			break;
 
+		case IP_FW3:	/* generic ipfw v.3 functions */
 		case IP_FW_ADD:
 		case IP_FW_DEL:
 		case IP_FW_FLUSH:
@@ -526,6 +529,7 @@ rip_ctloutput(struct socket *so, struct 
 				error = ENOPROTOOPT;
 			break;
 
+		case IP_DUMMYNET3:	/* generic dummynet v.3 functions */
 		case IP_DUMMYNET_CONFIGURE:
 		case IP_DUMMYNET_DEL:
 		case IP_DUMMYNET_FLUSH:


More information about the svn-src-all mailing list