[Users] Running DHCP on VPS, ( on a router.. )

Kirill Korotaev dev at sw.ru
Sun Sep 30 03:32:02 EDT 2007


oh, sorry, wrong patch :/
I've attached new debug patch, please check it.
It should print some information in /var/log/messages about what packets
are dropped and due to which condition.

Thanks a lot for your help!
Kirill
P.S. you can use in production kernel with removed filtering in veth_xmit() until it is resolved.


Dariush Pietrzak wrote:
>>Can you please revert previous patch and apply the one I attached?
>>Does it help?
> 
>  it crashes on boot on machine with veth-using vps, (clean machine boots
> ok though).
>  Screenshot attached
> 
> 
> 
> ------------------------------------------------------------------------
> 

-------------- next part --------------
--- ./drivers/net/veth.c.ve2346	2007-09-30 11:26:01.000000000 +0400
+++ ./drivers/net/veth.c	2007-09-30 11:30:45.000000000 +0400
@@ -282,22 +282,26 @@ static int veth_xmit(struct sk_buff *skb
 	struct net_device *rcv = NULL;
 	struct veth_struct *entry;
 	int length;
+	int reason = 0;
 
 	stats = veth_stats(dev, smp_processor_id());
 	if (unlikely(get_exec_env()->disable_net))
 		goto outf;
 
+	reason = 1;
 	entry = veth_from_netdev(dev);
 	rcv = entry->pair;
 	if (!rcv)
 		/* VE going down */
 		goto outf;
 
+	reason = 2;
 	if (!(rcv->flags & IFF_UP)) {
 		/* Target VE does not want to receive packets */
 		goto outf;
 	}
 
+	reason = 3;
 	if (unlikely(rcv->owner_env->disable_net))
 		goto outf;
 	/* Filtering */
@@ -309,12 +313,14 @@ static int veth_xmit(struct sk_buff *skb
 		if (is_multicast_ether_addr(
 					((struct ethhdr *)skb->data)->h_dest))
 			goto out;
+		reason = 4;
 		if (compare_ether_addr(((struct ethhdr *)skb->data)->h_dest,
 					rcv->dev_addr))
 			goto outf;
 	} else if (!ve_is_super(dev->owner_env) &&
 			!entry->allow_mac_change) {
 		/* from VE to VE0 */
+		reason = 5;
 		if (compare_ether_addr(((struct ethhdr *)skb->data)->h_source,
 					dev->dev_addr))
 			goto outf;
@@ -361,6 +367,23 @@ out:
 	return 0;
 
 outf:
+	{
+		unsigned char *addr;
+		int i;
+
+		printk("veth_xmit() dropped pkt reason %d:\n", reason);
+
+		addr = ((struct ethhdr *)skb->data)->h_source;
+		printk("  src = ");
+		for (i = 0; i < ETH_ALEN; i++)
+			printk("%02x:", addr[i]);
+
+		addr = ((struct ethhdr *)skb->data)->h_dest;
+		printk(", dst = ");
+		for (i = 0; i < ETH_ALEN; i++)
+			printk("%02x:", addr[i]);
+		printk("\n");
+	}
 	kfree_skb(skb);
 	stats->tx_dropped++;
 	return 0;


More information about the Users mailing list