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>
This commit is contained in:
parent
0373a94671
commit
4c139b8cce
|
@ -2037,6 +2037,9 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
|
||||||
memcpy(&(pkt_dev->hh[0]), pkt_dev->dst_mac, ETH_ALEN);
|
memcpy(&(pkt_dev->hh[0]), pkt_dev->dst_mac, ETH_ALEN);
|
||||||
|
|
||||||
if (pkt_dev->flags & F_IPV6) {
|
if (pkt_dev->flags & F_IPV6) {
|
||||||
|
int i, set = 0, err = 1;
|
||||||
|
struct inet6_dev *idev;
|
||||||
|
|
||||||
if (pkt_dev->min_pkt_size == 0) {
|
if (pkt_dev->min_pkt_size == 0) {
|
||||||
pkt_dev->min_pkt_size = 14 + sizeof(struct ipv6hdr)
|
pkt_dev->min_pkt_size = 14 + sizeof(struct ipv6hdr)
|
||||||
+ sizeof(struct udphdr)
|
+ sizeof(struct udphdr)
|
||||||
|
@ -2044,15 +2047,6 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
|
||||||
+ pkt_dev->pkt_overhead;
|
+ pkt_dev->pkt_overhead;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Skip this automatic address setting until locks or functions
|
|
||||||
* gets exported
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef NOTNOW
|
|
||||||
int i, set = 0, err = 1;
|
|
||||||
struct inet6_dev *idev;
|
|
||||||
|
|
||||||
for (i = 0; i < IN6_ADDR_HSIZE; i++)
|
for (i = 0; i < IN6_ADDR_HSIZE; i++)
|
||||||
if (pkt_dev->cur_in6_saddr.s6_addr[i]) {
|
if (pkt_dev->cur_in6_saddr.s6_addr[i]) {
|
||||||
set = 1;
|
set = 1;
|
||||||
|
@ -2073,9 +2067,8 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
|
||||||
struct inet6_ifaddr *ifp;
|
struct inet6_ifaddr *ifp;
|
||||||
|
|
||||||
read_lock_bh(&idev->lock);
|
read_lock_bh(&idev->lock);
|
||||||
for (ifp = idev->addr_list; ifp;
|
list_for_each_entry(ifp, &idev->addr_list, if_list) {
|
||||||
ifp = ifp->if_next) {
|
if ((ifp->scope & IFA_LINK) &&
|
||||||
if (ifp->scope == IFA_LINK &&
|
|
||||||
!(ifp->flags & IFA_F_TENTATIVE)) {
|
!(ifp->flags & IFA_F_TENTATIVE)) {
|
||||||
pkt_dev->cur_in6_saddr = ifp->addr;
|
pkt_dev->cur_in6_saddr = ifp->addr;
|
||||||
err = 0;
|
err = 0;
|
||||||
|
@ -2088,7 +2081,6 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
|
||||||
if (err)
|
if (err)
|
||||||
pr_err("ERROR: IPv6 link address not available\n");
|
pr_err("ERROR: IPv6 link address not available\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
if (pkt_dev->min_pkt_size == 0) {
|
if (pkt_dev->min_pkt_size == 0) {
|
||||||
pkt_dev->min_pkt_size = 14 + sizeof(struct iphdr)
|
pkt_dev->min_pkt_size = 14 + sizeof(struct iphdr)
|
||||||
|
|
Loading…
Reference in New Issue