aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAmerigo Wang <amwang@redhat.com>2012-10-09 13:48:19 -0400
committerDavid S. Miller <davem@davemloft.net>2012-10-10 22:33:30 -0400
commit4c139b8ccebaecdfad58eb068d61ef386f1a58ed (patch)
treef21b439a3348114f3be4434f40f9236375b4ee75 /net
parent0373a94671be1f5c823dbfc03617418d8effd5ce (diff)
pktgen: enable automatic IPv6 address setting
Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/pktgen.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index f9b4637e9f24..47fe18e6a8e4 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2037,6 +2037,9 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
2037 memcpy(&(pkt_dev->hh[0]), pkt_dev->dst_mac, ETH_ALEN); 2037 memcpy(&(pkt_dev->hh[0]), pkt_dev->dst_mac, ETH_ALEN);
2038 2038
2039 if (pkt_dev->flags & F_IPV6) { 2039 if (pkt_dev->flags & F_IPV6) {
2040 int i, set = 0, err = 1;
2041 struct inet6_dev *idev;
2042
2040 if (pkt_dev->min_pkt_size == 0) { 2043 if (pkt_dev->min_pkt_size == 0) {
2041 pkt_dev->min_pkt_size = 14 + sizeof(struct ipv6hdr) 2044 pkt_dev->min_pkt_size = 14 + sizeof(struct ipv6hdr)
2042 + sizeof(struct udphdr) 2045 + sizeof(struct udphdr)
@@ -2044,15 +2047,6 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
2044 + pkt_dev->pkt_overhead; 2047 + pkt_dev->pkt_overhead;
2045 } 2048 }
2046 2049
2047 /*
2048 * Skip this automatic address setting until locks or functions
2049 * gets exported
2050 */
2051
2052#ifdef NOTNOW
2053 int i, set = 0, err = 1;
2054 struct inet6_dev *idev;
2055
2056 for (i = 0; i < IN6_ADDR_HSIZE; i++) 2050 for (i = 0; i < IN6_ADDR_HSIZE; i++)
2057 if (pkt_dev->cur_in6_saddr.s6_addr[i]) { 2051 if (pkt_dev->cur_in6_saddr.s6_addr[i]) {
2058 set = 1; 2052 set = 1;
@@ -2073,9 +2067,8 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
2073 struct inet6_ifaddr *ifp; 2067 struct inet6_ifaddr *ifp;
2074 2068
2075 read_lock_bh(&idev->lock); 2069 read_lock_bh(&idev->lock);
2076 for (ifp = idev->addr_list; ifp; 2070 list_for_each_entry(ifp, &idev->addr_list, if_list) {
2077 ifp = ifp->if_next) { 2071 if ((ifp->scope & IFA_LINK) &&
2078 if (ifp->scope == IFA_LINK &&
2079 !(ifp->flags & IFA_F_TENTATIVE)) { 2072 !(ifp->flags & IFA_F_TENTATIVE)) {
2080 pkt_dev->cur_in6_saddr = ifp->addr; 2073 pkt_dev->cur_in6_saddr = ifp->addr;
2081 err = 0; 2074 err = 0;
@@ -2088,7 +2081,6 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
2088 if (err) 2081 if (err)
2089 pr_err("ERROR: IPv6 link address not available\n"); 2082 pr_err("ERROR: IPv6 link address not available\n");
2090 } 2083 }
2091#endif
2092 } else { 2084 } else {
2093 if (pkt_dev->min_pkt_size == 0) { 2085 if (pkt_dev->min_pkt_size == 0) {
2094 pkt_dev->min_pkt_size = 14 + sizeof(struct iphdr) 2086 pkt_dev->min_pkt_size = 14 + sizeof(struct iphdr)