net/ipv4/netfilter/ipt_CLUSTERIP.c
changeset 2 d1f6d8b6f81c
parent 0 aa628870c1d3
equal deleted inserted replaced
1:0056487c491e 2:d1f6d8b6f81c
   166 #ifdef CONFIG_PROC_FS
   166 #ifdef CONFIG_PROC_FS
   167 	{
   167 	{
   168 		char buffer[16];
   168 		char buffer[16];
   169 
   169 
   170 		/* create proc dir entry */
   170 		/* create proc dir entry */
   171 		sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip));
   171 		sprintf(buffer, "%pI4", &ip);
   172 		c->pde = proc_create_data(buffer, S_IWUSR|S_IRUSR,
   172 		c->pde = proc_create_data(buffer, S_IWUSR|S_IRUSR,
   173 					  clusterip_procdir,
   173 					  clusterip_procdir,
   174 					  &clusterip_proc_fops, c);
   174 					  &clusterip_proc_fops, c);
   175 		if (!c->pde) {
   175 		if (!c->pde) {
   176 			kfree(c);
   176 			kfree(c);
   371 	/* FIXME: further sanity checks */
   371 	/* FIXME: further sanity checks */
   372 
   372 
   373 	config = clusterip_config_find_get(e->ip.dst.s_addr, 1);
   373 	config = clusterip_config_find_get(e->ip.dst.s_addr, 1);
   374 	if (!config) {
   374 	if (!config) {
   375 		if (!(cipinfo->flags & CLUSTERIP_FLAG_NEW)) {
   375 		if (!(cipinfo->flags & CLUSTERIP_FLAG_NEW)) {
   376 			printk(KERN_WARNING "CLUSTERIP: no config found for %u.%u.%u.%u, need 'new'\n", NIPQUAD(e->ip.dst.s_addr));
   376 			printk(KERN_WARNING "CLUSTERIP: no config found for %pI4, need 'new'\n", &e->ip.dst.s_addr);
   377 			return false;
   377 			return false;
   378 		} else {
   378 		} else {
   379 			struct net_device *dev;
   379 			struct net_device *dev;
   380 
   380 
   381 			if (e->ip.iniface[0] == '\0') {
   381 			if (e->ip.iniface[0] == '\0') {
   476 		hbuffer[k++] = hex_asc_lo(payload->src_hw[j]);
   476 		hbuffer[k++] = hex_asc_lo(payload->src_hw[j]);
   477 		hbuffer[k++]=':';
   477 		hbuffer[k++]=':';
   478 	}
   478 	}
   479 	hbuffer[--k]='\0';
   479 	hbuffer[--k]='\0';
   480 
   480 
   481 	printk("src %u.%u.%u.%u@%s, dst %u.%u.%u.%u\n",
   481 	printk("src %pI4@%s, dst %pI4\n",
   482 		NIPQUAD(payload->src_ip), hbuffer,
   482 		&payload->src_ip, hbuffer, &payload->dst_ip);
   483 		NIPQUAD(payload->dst_ip));
       
   484 }
   483 }
   485 #endif
   484 #endif
   486 
   485 
   487 static unsigned int
   486 static unsigned int
   488 arp_mangle(unsigned int hook,
   487 arp_mangle(unsigned int hook,