aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/exthdrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/exthdrs.c')
-rw-r--r--net/ipv6/exthdrs.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 8a659f92d17a..853a633a94d4 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -874,3 +874,27 @@ struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
874 return opt; 874 return opt;
875} 875}
876 876
877/**
878 * fl6_update_dst - update flowi destination address with info given
879 * by srcrt option, if any.
880 *
881 * @fl: flowi for which fl6_dst is to be updated
882 * @opt: struct ipv6_txoptions in which to look for srcrt opt
883 * @orig: copy of original fl6_dst address if modified
884 *
885 * Returns NULL if no txoptions or no srcrt, otherwise returns orig
886 * and initial value of fl->fl6_dst set in orig
887 */
888struct in6_addr *fl6_update_dst(struct flowi *fl,
889 const struct ipv6_txoptions *opt,
890 struct in6_addr *orig)
891{
892 if (!opt || !opt->srcrt)
893 return NULL;
894
895 ipv6_addr_copy(orig, &fl->fl6_dst);
896 ipv6_addr_copy(&fl->fl6_dst, ((struct rt0_hdr *)opt->srcrt)->addr);
897 return orig;
898}
899
900EXPORT_SYMBOL_GPL(fl6_update_dst);