this patch for snat ARP proxy. man patch will be later
"Dmitry B. Khlonin" <dmitry-AsMeOOct1NhWk0Htik3J/[email protected]>
| Newsgroups | gmane.linux.network.bridge.ebtables.devel |
|---|---|
| Message-ID | <[email protected]> |
--- ebt_snat.c 7 Jul 2003 11:43:51 -0000 1.1
+++ ebt_snat.c 7 Jul 2003 12:07:49 -0000
@@ -11,15 +11,22 @@
#include <linux/netfilter_bridge/ebtables.h>
#include <linux/netfilter_bridge/ebt_nat.h>
#include <linux/module.h>
+#include <linux/if_arp.h>
static int ebt_target_snat(struct sk_buff **pskb, unsigned int hooknr,
const struct net_device *in, const struct net_device *out,
const void *data, unsigned int datalen)
{
struct ebt_nat_info *info = (struct ebt_nat_info *) data;
-
memcpy(((**pskb).mac.ethernet)->h_source, info->mac,
ETH_ALEN * sizeof(unsigned char));
+ if (ETH_P_ARP == ntohs(((**pskb).mac.ethernet)->h_proto))
+ memcpy((((**pskb).nh.raw) + sizeof(struct arphdr)),
+ info->mac, ETH_ALEN * sizeof(unsigned char));
return info->target;
}
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01