ipv6: Refactor update of IPv6 flowi destination address for srcrt (RH) option
authorArnaud Ebalard <arno@natisbad.org>
Tue, 1 Jun 2010 21:35:01 +0000 (21:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jun 2010 14:08:31 +0000 (07:08 -0700)
commit20c59de2e6b6bc74bbf714dcd4e720afe8d516cf
tree45e5c62e286368f8259b844cb7cf796d19066fb0
parentd92222e27fdc98d73df25f3d49fb1ff3a3369bec
ipv6: Refactor update of IPv6 flowi destination address for srcrt (RH) option

There are more than a dozen occurrences of following code in the
IPv6 stack:

    if (opt && opt->srcrt) {
            struct rt0_hdr *rt0 = (struct rt0_hdr *) opt->srcrt;
            ipv6_addr_copy(&final, &fl.fl6_dst);
            ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
            final_p = &final;
    }

Replace those with a helper. Note that the helper overrides final_p
in all cases. This is ok as final_p was previously initialized to
NULL when declared.

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ipv6.h
net/dccp/ipv6.c
net/ipv6/af_inet6.c
net/ipv6/datagram.c
net/ipv6/exthdrs.c
net/ipv6/inet6_connection_sock.c
net/ipv6/raw.c
net/ipv6/syncookies.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c