X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fcore%2Fdv.c;h=29ee77f15932465115d64f7f5d01d395e69af6d6;hb=cc169158e75d370ff961e5653a326a7ee1688b6b;hp=3f25f4aa4e66d558e4113791713c4d4167cdaeea;hpb=207e0a826fdee4bfe853681aef2175a739c11286;p=linux-2.6.git diff --git a/net/core/dv.c b/net/core/dv.c index 3f25f4aa4..29ee77f15 100644 --- a/net/core/dv.c +++ b/net/core/dv.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -54,15 +55,12 @@ int alloc_divert_blk(struct net_device *dev) dev->divert = NULL; if (dev->type == ARPHRD_ETHER) { - dev->divert = (struct divert_blk *) - kmalloc(alloc_size, GFP_KERNEL); + dev->divert = kzalloc(alloc_size, GFP_KERNEL); if (dev->divert == NULL) { printk(KERN_INFO "divert: unable to allocate divert_blk for %s\n", dev->name); return -ENOMEM; } - - memset(dev->divert, 0, sizeof(struct divert_blk)); dev_hold(dev); } @@ -457,7 +455,7 @@ void divert_frame(struct sk_buff *skb) unsigned char *skb_data_end = skb->data + skb->len; /* Packet is already aimed at us, return */ - if (!memcmp(eth, skb->dev->dev_addr, ETH_ALEN)) + if (!compare_ether_addr(eth->h_dest, skb->dev->dev_addr)) return; /* proto is not IP, do nothing */