Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0d098fc4
Commit
0d098fc4
authored
Mar 04, 2005
by
Hideaki Yoshifuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6] Ensure to use interface hoplimit by default.
Signed-off-by:
Hideaki YOSHIFUJI
<
yoshfuji@linux-ipv6.org
>
parent
8b123d00
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
12 deletions
+20
-12
include/net/addrconf.h
include/net/addrconf.h
+2
-0
net/ipv6/icmp.c
net/ipv6/icmp.c
+4
-0
net/ipv6/ip6_output.c
net/ipv6/ip6_output.c
+2
-0
net/ipv6/ndisc.c
net/ipv6/ndisc.c
+4
-1
net/ipv6/raw.c
net/ipv6/raw.c
+2
-0
net/ipv6/route.c
net/ipv6/route.c
+4
-11
net/ipv6/udp.c
net/ipv6/udp.c
+2
-0
No files found.
include/net/addrconf.h
View file @
0d098fc4
...
...
@@ -102,6 +102,8 @@ extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr);
extern
void
addrconf_prefix_rcv
(
struct
net_device
*
dev
,
u8
*
opt
,
int
len
);
extern
int
ipv6_get_hoplimit
(
struct
net_device
*
dev
);
/*
* anycast prototypes (anycast.c)
*/
...
...
net/ipv6/icmp.c
View file @
0d098fc4
...
...
@@ -381,6 +381,8 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
hlimit
=
np
->
hop_limit
;
if
(
hlimit
<
0
)
hlimit
=
dst_metric
(
dst
,
RTAX_HOPLIMIT
);
if
(
hlimit
<
0
)
hlimit
=
ipv6_get_hoplimit
(
dst
->
dev
);
msg
.
skb
=
skb
;
msg
.
offset
=
skb
->
nh
.
raw
-
skb
->
data
;
...
...
@@ -467,6 +469,8 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
hlimit
=
np
->
hop_limit
;
if
(
hlimit
<
0
)
hlimit
=
dst_metric
(
dst
,
RTAX_HOPLIMIT
);
if
(
hlimit
<
0
)
hlimit
=
ipv6_get_hoplimit
(
dst
->
dev
);
idev
=
in6_dev_get
(
skb
->
dev
);
...
...
net/ipv6/ip6_output.c
View file @
0d098fc4
...
...
@@ -253,6 +253,8 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
hlimit
=
np
->
hop_limit
;
if
(
hlimit
<
0
)
hlimit
=
dst_metric
(
dst
,
RTAX_HOPLIMIT
);
if
(
hlimit
<
0
)
hlimit
=
ipv6_get_hoplimit
(
dst
->
dev
);
hdr
->
payload_len
=
htons
(
seg_len
);
hdr
->
nexthdr
=
proto
;
...
...
net/ipv6/ndisc.c
View file @
0d098fc4
...
...
@@ -1128,8 +1128,11 @@ static void ndisc_router_discovery(struct sk_buff *skb)
if
(
rt
)
rt
->
rt6i_expires
=
jiffies
+
(
HZ
*
lifetime
);
if
(
ra_msg
->
icmph
.
icmp6_hop_limit
)
if
(
ra_msg
->
icmph
.
icmp6_hop_limit
)
{
in6_dev
->
cnf
.
hop_limit
=
ra_msg
->
icmph
.
icmp6_hop_limit
;
if
(
rt
)
rt
->
u
.
dst
.
metrics
[
RTAX_HOPLIMIT
-
1
]
=
ra_msg
->
icmph
.
icmp6_hop_limit
;
}
/*
* Update Reachable Time and Retrans Timer
...
...
net/ipv6/raw.c
View file @
0d098fc4
...
...
@@ -756,6 +756,8 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
hlimit
=
np
->
hop_limit
;
if
(
hlimit
<
0
)
hlimit
=
dst_metric
(
dst
,
RTAX_HOPLIMIT
);
if
(
hlimit
<
0
)
hlimit
=
ipv6_get_hoplimit
(
dst
->
dev
);
}
if
(
msg
->
msg_flags
&
MSG_CONFIRM
)
...
...
net/ipv6/route.c
View file @
0d098fc4
...
...
@@ -771,7 +771,7 @@ static int ipv6_get_mtu(struct net_device *dev)
return
mtu
;
}
static
int
ipv6_get_hoplimit
(
struct
net_device
*
dev
)
int
ipv6_get_hoplimit
(
struct
net_device
*
dev
)
{
int
hoplimit
=
ipv6_devconf
.
hop_limit
;
struct
inet6_dev
*
idev
;
...
...
@@ -967,15 +967,8 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh, void *_rtattr)
}
}
if
(
rt
->
u
.
dst
.
metrics
[
RTAX_HOPLIMIT
-
1
]
==
0
)
{
if
(
ipv6_addr_is_multicast
(
&
rt
->
rt6i_dst
.
addr
))
rt
->
u
.
dst
.
metrics
[
RTAX_HOPLIMIT
-
1
]
=
IPV6_DEFAULT_MCASTHOPS
;
else
rt
->
u
.
dst
.
metrics
[
RTAX_HOPLIMIT
-
1
]
=
ipv6_get_hoplimit
(
dev
);
}
if
(
rt
->
u
.
dst
.
metrics
[
RTAX_HOPLIMIT
-
1
]
==
0
)
rt
->
u
.
dst
.
metrics
[
RTAX_HOPLIMIT
-
1
]
=
-
1
;
if
(
!
rt
->
u
.
dst
.
metrics
[
RTAX_MTU
-
1
])
rt
->
u
.
dst
.
metrics
[
RTAX_MTU
-
1
]
=
ipv6_get_mtu
(
dev
);
if
(
!
rt
->
u
.
dst
.
metrics
[
RTAX_ADVMSS
-
1
])
...
...
@@ -1414,7 +1407,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
rt
->
rt6i_idev
=
idev
;
rt
->
u
.
dst
.
metrics
[
RTAX_MTU
-
1
]
=
ipv6_get_mtu
(
rt
->
rt6i_dev
);
rt
->
u
.
dst
.
metrics
[
RTAX_ADVMSS
-
1
]
=
ipv6_advmss
(
dst_pmtu
(
&
rt
->
u
.
dst
));
rt
->
u
.
dst
.
metrics
[
RTAX_HOPLIMIT
-
1
]
=
ipv6_get_hoplimit
(
rt
->
rt6i_dev
)
;
rt
->
u
.
dst
.
metrics
[
RTAX_HOPLIMIT
-
1
]
=
-
1
;
rt
->
u
.
dst
.
obsolete
=
-
1
;
rt
->
rt6i_flags
=
RTF_UP
|
RTF_NONEXTHOP
;
...
...
net/ipv6/udp.c
View file @
0d098fc4
...
...
@@ -811,6 +811,8 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
hlimit
=
np
->
hop_limit
;
if
(
hlimit
<
0
)
hlimit
=
dst_metric
(
dst
,
RTAX_HOPLIMIT
);
if
(
hlimit
<
0
)
hlimit
=
ipv6_get_hoplimit
(
dst
->
dev
);
}
if
(
msg
->
msg_flags
&
MSG_CONFIRM
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment