socsvn commit: r270653 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw

dpl at FreeBSD.org dpl at FreeBSD.org
Wed Jul 9 14:33:51 UTC 2014


Author: dpl
Date: Wed Jul  9 14:33:50 2014
New Revision: 270653
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=270653

Log:
  Corrected the lacking #ifdef INET6 at ip_fw_rules.h
  

Modified:
  soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw_rules.h

Modified: soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw_rules.h
==============================================================================
--- soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw_rules.h	Wed Jul  9 13:37:24 2014	(r270652)
+++ soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw_rules.h	Wed Jul  9 14:33:50 2014	(r270653)
@@ -347,16 +347,6 @@
 	return (type <= ICMP6_MAXTYPE && (cmd->d[type/32] & (1<<(type%32)) ) );
 }
 
-static int
-flow6id_match( int curr_flow, ipfw_insn_u32 *cmd )
-{
-	int i;
-	for (i=0; i <= cmd->o.arg1; ++i )
-		if (curr_flow == cmd->d[i] )
-			return 1;
-	return 0;
-}
-
 /* support for IP6_*_ME opcodes */
 static int
 search_ip6_addr_net (struct in6_addr * ip6_addr)
@@ -386,6 +376,16 @@
 }
 
 static int
+flow6id_match( int curr_flow, ipfw_insn_u32 *cmd )
+{
+	int i;
+	for (i=0; i <= cmd->o.arg1; ++i )
+		if (curr_flow == cmd->d[i] )
+			return 1;
+	return 0;
+}
+
+static int
 verify_path6(struct in6_addr *src, struct ifnet *ifp, u_int fib)
 {
 	struct route_in6 ro;
@@ -697,7 +697,6 @@
 
 /*
  * Actions executed per-rule.
- * We'll have to include some of the included files at ip_fw2.c
  */
 
 inline void
@@ -940,15 +939,19 @@
 		*match = (tif != NULL);
 		return;
 	}
+#ifdef INET6
 	/* also added to the next function */
 	*match= is_ipv6 && search_ip6_addr_net(&args->f_id.src_ip6);
+#endif /* INET6 */
 }
 
+#ifdef INET6
 static inline void
 rule_ip6_src_me(int *match, int is_ipv6, struct ip_fw_args *args)
 {
 	*match= is_ipv6 && search_ip6_addr_net(&args->f_id.src_ip6);
 }
+#endif /* INET6 */
 
 inline void
 rule_ip_src_set(int *match, int is_ipv4, ipfw_insn *cmd, struct ip_fw_args *args)
@@ -987,14 +990,18 @@
 		*match = (tif != NULL);
 		return;
 	}
+#ifdef INET6
 	*match= is_ipv6 && search_ip6_addr_net(&args->f_id.dst_ip6);
+#endif /* INET6 */
 }
 
+#ifdef INET6
 static inline void
 rule_ip6_dst_me(int *match, struct ip_fw_args *args, int is_ipv6)
 {
 	*match= is_ipv6 && search_ip6_addr_net(&args->f_id.dst_ip6);
 }
+#endif /* INET6 */
 
 inline void
 rule_ip_dstport(int *match, uint8_t proto, u_short offset, ipfw_insn *cmd, int cmdlen, uint16_t dst_port, uint16_t src_port)
@@ -1026,6 +1033,7 @@
 	    icmptype_match(ICMP(ulp), (ipfw_insn_u32 *)cmd) );
 }
 
+#ifdef INET6
 inline void
 rule_icmp6type(int *match, u_short offset, int is_ipv6, uint8_t proto, void *ulp, ipfw_insn *cmd)
 {
@@ -1035,6 +1043,7 @@
 		    ICMP6((void *)ulp)->icmp6_type,
 		    (ipfw_insn_u32 *)cmd);
 }
+#endif /* INET6 */
 
 
 static inline void
@@ -1296,7 +1305,7 @@
 	    verify_path(*src_ip, NULL, args->f_id.fib)));
 }
 
-/* dpl XXX We could pass pointers to strcut in_addr at in_localaddr() */
+/* dpl XXX We could pass pointers to struct in_addr at in_localaddr() */
 static inline void
 rule_antispoof(int *match, struct ifnet *oif, u_int hlen, int is_ipv4, int is_ipv6, struct in_addr *src_ip, struct ip_fw_args *args, struct mbuf *m)
 {


More information about the svn-soc-all mailing list