diff -Naur conntrack-1.00beta2_orig/include/conntrack.h conntrack-1.00beta2/include/conntrack.h
--- conntrack-1.00beta2_orig/include/conntrack.h	2007-11-01 00:24:39.000000000 -0700
+++ conntrack-1.00beta2/include/conntrack.h	2007-11-01 00:33:04.000000000 -0700
@@ -118,7 +118,10 @@
 	CT_OPT_FAMILY_BIT	= 16,
 	CT_OPT_FAMILY		= (1 << CT_OPT_FAMILY_BIT),
 
-	CT_OPT_MAX_BIT		= CT_OPT_FAMILY_BIT
+	CT_OPT_ADDR_BIT		= 17,
+	CT_OPT_ADDR		= (1 << CT_OPT_ADDR_BIT),
+
+	CT_OPT_MAX_BIT		= CT_OPT_ADDR_BIT
 };
 #define NUMBER_OF_OPT   CT_OPT_MAX_BIT+1
 
diff -Naur conntrack-1.00beta2_orig/src/conntrack.c conntrack-1.00beta2/src/conntrack.c
--- conntrack-1.00beta2_orig/src/conntrack.c	2007-11-01 00:24:39.000000000 -0700
+++ conntrack-1.00beta2/src/conntrack.c	2007-11-01 05:39:42.000000000 -0700
@@ -67,7 +67,7 @@
 static struct option original_opts[] = {
 	{"dump", 2, 0, 'L'},
 	{"create", 1, 0, 'I'},
-	{"delete", 1, 0, 'D'},
+	{"delete", 2, 0, 'D'},
 	{"update", 1, 0, 'U'},
 	{"get", 1, 0, 'G'},
 	{"flush", 1, 0, 'F'},
@@ -91,6 +91,7 @@
 	{"mark", 1, 0, 'm'},
 	{"id", 2, 0, 'i'},
 	{"family", 1, 0, 'f'},
+	{"addr", 1, 0, 'A'},
 	{0, 0, 0, 0}
 };
 
@@ -112,22 +113,22 @@
 static char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] =
 /* Well, it's better than "Re: Linux vs FreeBSD" */
 {
-          /*   s d r q p t u z e x y k l a m i f*/
-/*CT_LIST*/   {2,2,2,2,2,0,0,2,0,0,0,0,0,0,2,2,2},
-/*CT_CREATE*/ {2,2,2,2,1,1,1,0,0,0,0,0,0,2,2,0,0},
-/*CT_UPDATE*/ {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0,0,0,0,0,0,0,0,0,0,0},
+/*HELP*/      {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+/*EXP_LIST*/  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0},
+/*EXP_CREATE*/{1,1,2,2,1,1,2,0,0,1,1,1,1,0,0,0,0,0},
+/*EXP_DELETE*/{1,1,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
+/*EXP_GET*/   {1,1,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
+/*EXP_FLUSH*/ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+/*EXP_EVENT*/ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 };
 
 static char *lib_dir = CONNTRACK_LIB_DIR;
@@ -525,6 +526,41 @@
 		range->max_ip = parse.addr.s_addr;
 }
 
+static int contrack_delete_mask(void *arg, unsigned int flags, int type,
+                                   void *data)
+{
+	int res = 0;
+	struct nfct_conntrack * p_ct = (struct nfct_conntrack *) arg;
+	struct nfct_tuple * p_mask = (struct nfct_tuple *) data;
+
+	if(!res)
+	{
+		struct nfct_handle *temp_cth;
+
+		/* only works for ipv4 */
+		if((p_mask->src.v4 == p_ct->tuple[NFCT_DIR_ORIGINAL].src.v4) || (p_mask->src.v4 == p_ct->tuple[NFCT_DIR_ORIGINAL].dst.v4))
+		{
+		        fprintf(stdout, "Deleting ");
+			res = nfct_default_conntrack_display(arg, flags, type, NULL);
+	                temp_cth = nfct_open(CONNTRACK, 0);
+        	        if (!cth)
+                	        exit_error(OTHER_PROBLEM, "Can't open handler");
+                        res = nfct_delete_conntrack(temp_cth, &p_ct->tuple[NFCT_DIR_ORIGINAL],
+                                                    NFCT_DIR_ORIGINAL,
+                                                    NFCT_ANY_ID);
+			nfct_close(temp_cth);
+		        if (res < 0) {
+                		fprintf(stderr, "Operation failed: %s\n", err2str(res, CT_DELETE));
+                		exit(OTHER_PROBLEM);
+			}
+ 
+		}
+
+	}
+
+	return res;	
+}
+
 static void event_sighandler(int s)
 {
 	fprintf(stdout, "Now closing conntrack event dumping...\n");
@@ -587,7 +623,7 @@
 
 #define CT_COMPARISON (CT_OPT_PROTO | CT_OPT_ORIG | CT_OPT_REPL | CT_OPT_MARK)
 
-static struct nfct_tuple orig, reply, mask;
+static struct nfct_tuple orig, reply, mask, del_addr;
 static struct nfct_tuple exptuple;
 static struct ctproto_handler *h;
 static union nfct_protoinfo proto;
@@ -611,7 +647,7 @@
 	struct nfct_conntrack_compare *pcmp;
 
 	while ((c = getopt_long(argc, argv, 
-		"L::I::U::D::G::E::F::hVs:d:r:q:p:t:u:e:a:z[:]:{:}:m:i::f:", 
+		"L::I::U::D::G::E::F::hVs:d:r:q:p:t:u:e:a:z[:]:{:}:m:i::f:A:", 
 		opts, NULL)) != -1) {
 	switch(c) {
 		case 'L':
@@ -815,6 +851,18 @@
 				exit_error(PARAMETER_PROBLEM, "Unknown "
 					   "protocol family\n");
 			break;
+		case 'A':
+			options |= CT_OPT_ADDR;
+                        if (optarg) {
+                                orig.l3protonum =
+                                        parse_inetaddr(optarg, &del_addr.src);
+                                set_family(&family, del_addr.l3protonum);
+                                if (del_addr.l3protonum == AF_INET)
+                                        l3flags |= IPV4_ORIG_SRC;
+                                else if (del_addr.l3protonum == AF_INET6)
+                                        l3flags |= IPV6_ORIG_SRC;
+                        }
+			break;
 		default:
 			if (h && h->parse_opts 
 			    &&!h->parse_opts(c - h->option_offset, argv, &orig, 
@@ -988,7 +1036,7 @@
 		break;
 		
 	case CT_DELETE:
-		if (!(options & CT_OPT_ORIG) && !(options & CT_OPT_REPL))
+		if (!(options & CT_OPT_ADDR) && !(options & CT_OPT_ORIG) && !(options & CT_OPT_REPL))
 			exit_error(PARAMETER_PROBLEM, "Can't kill conntracks "
 						      "just by its ID");
 		cth = nfct_open(CONNTRACK, 0);
@@ -1002,6 +1050,16 @@
 			res = nfct_delete_conntrack(cth, &reply, 
 						    NFCT_DIR_REPLY,
 						    id);
+		else if (options & CT_OPT_ADDR)
+		{
+			if(family != AF_INET)
+                        exit_error(PARAMETER_PROBLEM, "-A option only "
+                                                      "works for ipv4");
+                        nfct_register_callback(cth,
+                                               contrack_delete_mask,
+                                               (void *) &del_addr);
+                        res = nfct_dump_conntrack_table(cth, family);
+		}
 		nfct_close(cth);
 		break;
 
