Skip to content

Commit abbf46a

Browse files
committed
ipv6: Use ip6_dst_hoplimit() instead of direct dst_metric() calls.
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1635953 commit abbf46a

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

net/ipv6/netfilter/ip6t_REJECT.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
124124
skb_reset_network_header(nskb);
125125
ip6h = ipv6_hdr(nskb);
126126
ip6h->version = 6;
127-
ip6h->hop_limit = dst_metric(dst, RTAX_HOPLIMIT);
127+
ip6h->hop_limit = ip6_dst_hoplimit(dst);
128128
ip6h->nexthdr = IPPROTO_TCP;
129129
ipv6_addr_copy(&ip6h->saddr, &oip6h->daddr);
130130
ipv6_addr_copy(&ip6h->daddr, &oip6h->saddr);

net/ipv6/route.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ int ip6_dst_hoplimit(struct dst_entry *dst)
11191119
}
11201120
return hoplimit;
11211121
}
1122+
EXPORT_SYMBOL(ip6_dst_hoplimit);
11221123

11231124
/*
11241125
*

net/ipv6/xfrm6_mode_tunnel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <net/dsfield.h>
1515
#include <net/dst.h>
1616
#include <net/inet_ecn.h>
17+
#include <net/ip6_route.h>
1718
#include <net/ipv6.h>
1819
#include <net/xfrm.h>
1920

@@ -53,7 +54,7 @@ static int xfrm6_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
5354
if (x->props.flags & XFRM_STATE_NOECN)
5455
dsfield &= ~INET_ECN_MASK;
5556
ipv6_change_dsfield(top_iph, 0, dsfield);
56-
top_iph->hop_limit = dst_metric(dst->child, RTAX_HOPLIMIT);
57+
top_iph->hop_limit = ip6_dst_hoplimit(dst->child);
5758
ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr);
5859
ipv6_addr_copy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr);
5960
return 0;

0 commit comments

Comments
 (0)