--- v2.4.16/linux/include/linux/inetdevice.h Tue Nov 13 01:27:21 2001 +++ linux/include/linux/inetdevice.h Sat Dec 8 11:56:18 2001 @@ -12,6 +12,7 @@ int accept_source_route; int rp_filter; int proxy_arp; + int medium_id; int bootp_relay; int log_martians; int forwarding; @@ -48,6 +49,7 @@ #define IN_DEV_TX_REDIRECTS(in_dev) (ipv4_devconf.send_redirects || (in_dev)->cnf.send_redirects) #define IN_DEV_SEC_REDIRECTS(in_dev) (ipv4_devconf.secure_redirects || (in_dev)->cnf.secure_redirects) #define IN_DEV_IDTAG(in_dev) ((in_dev)->cnf.tag) +#define IN_DEV_MEDIUM_ID(in_dev) ((in_dev)->cnf.medium_id) #define IN_DEV_RX_REDIRECTS(in_dev) \ ((IN_DEV_FORWARD(in_dev) && \ --- v2.4.16/linux/include/linux/sysctl.h Mon Nov 26 23:06:56 2001 +++ linux/include/linux/sysctl.h Sat Dec 8 11:58:05 2001 @@ -334,7 +334,8 @@ NET_IPV4_CONF_BOOTP_RELAY=10, NET_IPV4_CONF_LOG_MARTIANS=11, NET_IPV4_CONF_TAG=12, - NET_IPV4_CONF_ARPFILTER=13 + NET_IPV4_CONF_ARPFILTER=13, + NET_IPV4_CONF_MEDIUM_ID=14, }; /* /proc/sys/net/ipv6 */ --- v2.4.16/linux/net/ipv4/arp.c Tue Nov 13 01:28:51 2001 +++ linux/net/ipv4/arp.c Sat Dec 8 13:11:58 2001 @@ -450,6 +450,30 @@ } /* + * Check if we can use proxy ARP for this path + */ + +static inline int arp_fwd_proxy(struct in_device *in_dev, struct rtable *rt) +{ +struct in_device *out_dev; +int imi, omi = 0; + + if (IN_DEV_PROXY_ARP(in_dev)) + return 1; + + /* place to check for proxy_arp for routes */ + + if (!(imi = IN_DEV_MEDIUM_ID(in_dev))) + return 0; + out_dev = in_dev_get(rt->u.dst.dev); + if (out_dev) { + omi = IN_DEV_MEDIUM_ID(out_dev); + in_dev_put(out_dev); + } + return (imi != omi && omi); +} + +/* * Interface to link layer: send routine and receive handler. */ @@ -768,7 +792,7 @@ } else if (IN_DEV_FORWARD(in_dev)) { if ((rt->rt_flags&RTCF_DNAT) || (addr_type == RTN_UNICAST && rt->u.dst.dev != dev && - (IN_DEV_PROXY_ARP(in_dev) || pneigh_lookup(&arp_tbl, &tip, dev, 0)))) { + (arp_fwd_proxy(in_dev, rt) || pneigh_lookup(&arp_tbl, &tip, dev, 0)))) { n = neigh_event_ns(&arp_tbl, sha, &sip, dev); if (n) neigh_release(n); --- v2.4.16/linux/net/ipv4/devinet.c Tue Nov 13 01:29:33 2001 +++ linux/net/ipv4/devinet.c Sat Dec 8 12:00:54 2001 @@ -1044,7 +1044,7 @@ static struct devinet_sysctl_table { struct ctl_table_header *sysctl_header; - ctl_table devinet_vars[14]; + ctl_table devinet_vars[15]; ctl_table devinet_dev[2]; ctl_table devinet_conf_dir[2]; ctl_table devinet_proto_dir[2]; @@ -1077,6 +1077,9 @@ &proc_dointvec}, {NET_IPV4_CONF_PROXY_ARP, "proxy_arp", &ipv4_devconf.proxy_arp, sizeof(int), 0644, NULL, + &proc_dointvec}, + {NET_IPV4_CONF_MEDIUM_ID, "medium_id", + &ipv4_devconf.medium_id, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_IPV4_CONF_BOOTP_RELAY, "bootp_relay", &ipv4_devconf.bootp_relay, sizeof(int), 0644, NULL, --- v2.4.16/linux/Documentation/filesystems/proc.txt Mon Nov 26 23:05:49 2001 +++ linux/Documentation/filesystems/proc.txt Sat Dec 8 12:32:08 2001 @@ -1549,6 +1549,19 @@ Do multicast routing. The kernel needs to be compiled with CONFIG_MROUTE and a multicast routing daemon is required. +medium_id +--------- + +Integer value used to differentiate the devices by the medium they +are attached to. Currently, it is used to change the proxy_arp +behavior: we assume that the proxy_arp feature is enabled for +packets forwarded between two devices with different medium id +but only when their id is not 0. The default value 0 means the +medium id is not known and the above assumption can not be made. +Two devices can have different id values when the broadcast +packets are received only on one of them. +This value is independent from the proxy_arp flag. + proxy_arp --------- --- v2.4.16/linux/Documentation/networking/ip-sysctl.txt Tue Nov 13 01:25:32 2001 +++ linux/Documentation/networking/ip-sysctl.txt Sat Dec 8 12:33:46 2001 @@ -351,6 +351,18 @@ Do multicast routing. The kernel needs to be compiled with CONFIG_MROUTE and a multicast routing daemon is required. +medium_id - INTEGER + + Integer value used to differentiate the devices by the medium they + are attached to. Currently, it is used to change the proxy_arp + behavior: we assume that the proxy_arp feature is enabled for + packets forwarded between two devices with different medium id + but only when their id is not 0. The default value 0 means the + medium id is not known and the above assumption can not be made. + Two devices can have different id values when the broadcast + packets are received only on one of them. + This value is independent from the proxy_arp flag. + proxy_arp - BOOLEAN Do proxy arp.