[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-netdev
Subject: [PATCH] IPv6: (3/5) Set dev->dev_addr and dev->broadcast in ip6_tnls
From: Ville Nuorvala <vnuorval () tcs ! hut ! fi>
Date: 2003-08-31 23:48:55
[Download RAW message or body]
Hi,
I just only recently noticed MAX_ADDR_LEN had beed increased to 32. This
means the IPv6 addresses can now be copied into the dev->dev_addr and
dev->broadcast fields, just like the IPv4 addresses are for the other
tunnel drivers. Please apply!
Thanks,
Ville
--
Ville Nuorvala
Research Assistant, Institute of Digital Communications,
Helsinki University of Technology
email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257
["ip6_tnl_dev_addr.patch" (TEXT/PLAIN)]
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1276.28.2 -> 1.1276.28.3
# net/ipv6/ip6_tunnel.c 1.8 -> 1.9
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/09/01 vnuorval@dsl-hkigw1a8b.dial.inet.fi 1.1276.28.3
# Copy tunnel addresses to dev->dev_addr and dev->broadcast like in the
# other tunnel drivers.
# --------------------------------------------
#
diff -Nru a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
--- a/net/ipv6/ip6_tunnel.c Mon Sep 1 01:57:58 2003
+++ b/net/ipv6/ip6_tunnel.c Mon Sep 1 01:57:58 2003
@@ -851,6 +851,10 @@
struct net_device *dev = t->dev;
struct ip6_tnl_parm *p = &t->parms;
struct flowi *fl;
+
+ memcpy(&dev->dev_addr, &p->laddr, sizeof(struct in6_addr));
+ memcpy(&dev->broadcast, &p->raddr, sizeof(struct in6_addr));
+
/* Set up flowi template */
fl = &t->fl;
ipv6_addr_copy(&fl->fl6_src, &p->laddr);
@@ -1093,10 +1097,7 @@
dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr);
dev->flags |= IFF_NOARP;
dev->iflink = 0;
- /* Hmm... MAX_ADDR_LEN is 8, so the ipv6 addresses can't be
- copied to dev->dev_addr and dev->broadcast, like the ipv4
- addresses were in ipip.c, ip_gre.c and sit.c. */
- dev->addr_len = 0;
+ dev->addr_len = sizeof(struct in6_addr);
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic