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
6df6efbb
Commit
6df6efbb
authored
Jun 25, 2003
by
Hideaki Yoshifuji
Committed by
James Morris
Jun 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6] use macro for maximum payload length
parent
2a7dd335
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
12 deletions
+14
-12
include/net/ipv6.h
include/net/ipv6.h
+2
-0
net/ipv6/exthdrs.c
net/ipv6/exthdrs.c
+1
-1
net/ipv6/ip6_output.c
net/ipv6/ip6_output.c
+4
-4
net/ipv6/reassembly.c
net/ipv6/reassembly.c
+2
-2
net/ipv6/route.c
net/ipv6/route.c
+5
-5
No files found.
include/net/ipv6.h
View file @
6df6efbb
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
#define SIN6_LEN_RFC2133 24
#define SIN6_LEN_RFC2133 24
#define IPV6_MAXPLEN 65535
/*
/*
* NextHeader field of IPv6 header
* NextHeader field of IPv6 header
*/
*/
...
...
net/ipv6/exthdrs.c
View file @
6df6efbb
...
@@ -432,7 +432,7 @@ static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff)
...
@@ -432,7 +432,7 @@ static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff)
}
}
pkt_len
=
ntohl
(
*
(
u32
*
)(
skb
->
nh
.
raw
+
optoff
+
2
));
pkt_len
=
ntohl
(
*
(
u32
*
)(
skb
->
nh
.
raw
+
optoff
+
2
));
if
(
pkt_len
<
0x10000
)
{
if
(
pkt_len
<
=
IPV6_MAXPLEN
)
{
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
optoff
+
2
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
optoff
+
2
);
return
0
;
return
0
;
}
}
...
...
net/ipv6/ip6_output.c
View file @
6df6efbb
...
@@ -621,7 +621,7 @@ int ip6_build_xmit(struct sock *sk, inet_getfrag_t getfrag, const void *data,
...
@@ -621,7 +621,7 @@ int ip6_build_xmit(struct sock *sk, inet_getfrag_t getfrag, const void *data,
if
(
opt
)
if
(
opt
)
pktlength
+=
opt
->
opt_flen
+
opt
->
opt_nflen
;
pktlength
+=
opt
->
opt_flen
+
opt
->
opt_nflen
;
if
(
pktlength
>
0xFFFF
+
sizeof
(
struct
ipv6hdr
)
)
{
if
(
pktlength
>
sizeof
(
struct
ipv6hdr
)
+
IPV6_MAXPLEN
)
{
/* Jumbo datagram.
/* Jumbo datagram.
It is assumed, that in the case of hdrincl
It is assumed, that in the case of hdrincl
jumbo option is supplied by user.
jumbo option is supplied by user.
...
@@ -1264,8 +1264,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
...
@@ -1264,8 +1264,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
fragheaderlen
=
sizeof
(
struct
ipv6hdr
)
+
(
opt
?
opt
->
opt_nflen
:
0
);
fragheaderlen
=
sizeof
(
struct
ipv6hdr
)
+
(
opt
?
opt
->
opt_nflen
:
0
);
maxfraglen
=
((
mtu
-
fragheaderlen
)
&
~
7
)
+
fragheaderlen
-
sizeof
(
struct
frag_hdr
);
maxfraglen
=
((
mtu
-
fragheaderlen
)
&
~
7
)
+
fragheaderlen
-
sizeof
(
struct
frag_hdr
);
if
(
mtu
<
65576
)
{
if
(
mtu
<
=
sizeof
(
struct
ipv6hdr
)
+
IPV6_MAXPLEN
)
{
if
(
inet
->
cork
.
length
+
length
>
0xFFFF
-
fragheaderlen
)
{
if
(
inet
->
cork
.
length
+
length
>
IPV6_MAXPLEN
-
fragheaderlen
)
{
ipv6_local_error
(
sk
,
EMSGSIZE
,
fl
,
mtu
-
exthdrlen
);
ipv6_local_error
(
sk
,
EMSGSIZE
,
fl
,
mtu
-
exthdrlen
);
return
-
EMSGSIZE
;
return
-
EMSGSIZE
;
}
}
...
@@ -1461,7 +1461,7 @@ int ip6_push_pending_frames(struct sock *sk)
...
@@ -1461,7 +1461,7 @@ int ip6_push_pending_frames(struct sock *sk)
*
(
u32
*
)
hdr
=
fl
->
fl6_flowlabel
|
htonl
(
0x60000000
);
*
(
u32
*
)
hdr
=
fl
->
fl6_flowlabel
|
htonl
(
0x60000000
);
if
(
skb
->
len
<
65536
)
if
(
skb
->
len
<
=
IPV6_MAXPLEN
)
hdr
->
payload_len
=
htons
(
skb
->
len
-
sizeof
(
struct
ipv6hdr
));
hdr
->
payload_len
=
htons
(
skb
->
len
-
sizeof
(
struct
ipv6hdr
));
else
else
hdr
->
payload_len
=
0
;
hdr
->
payload_len
=
0
;
...
...
net/ipv6/reassembly.c
View file @
6df6efbb
...
@@ -425,7 +425,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
...
@@ -425,7 +425,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
end
=
offset
+
(
ntohs
(
skb
->
nh
.
ipv6h
->
payload_len
)
-
end
=
offset
+
(
ntohs
(
skb
->
nh
.
ipv6h
->
payload_len
)
-
((
u8
*
)
(
fhdr
+
1
)
-
(
u8
*
)
(
skb
->
nh
.
ipv6h
+
1
)));
((
u8
*
)
(
fhdr
+
1
)
-
(
u8
*
)
(
skb
->
nh
.
ipv6h
+
1
)));
if
((
unsigned
int
)
end
>
=
65536
)
{
if
((
unsigned
int
)
end
>
IPV6_MAXPLEN
)
{
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
(
u8
*
)
&
fhdr
->
frag_off
-
skb
->
nh
.
raw
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
(
u8
*
)
&
fhdr
->
frag_off
-
skb
->
nh
.
raw
);
return
;
return
;
}
}
...
@@ -597,7 +597,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
...
@@ -597,7 +597,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
/* Unfragmented part is taken from the first segment. */
/* Unfragmented part is taken from the first segment. */
payload_len
=
(
head
->
data
-
head
->
nh
.
raw
)
-
sizeof
(
struct
ipv6hdr
)
+
fq
->
len
-
sizeof
(
struct
frag_hdr
);
payload_len
=
(
head
->
data
-
head
->
nh
.
raw
)
-
sizeof
(
struct
ipv6hdr
)
+
fq
->
len
-
sizeof
(
struct
frag_hdr
);
if
(
payload_len
>
65535
)
if
(
payload_len
>
IPV6_MAXPLEN
)
goto
out_oversize
;
goto
out_oversize
;
/* Head of list must not be cloned. */
/* Head of list must not be cloned. */
...
...
net/ipv6/route.c
View file @
6df6efbb
...
@@ -606,13 +606,13 @@ static inline unsigned int ipv6_advmss(unsigned int mtu)
...
@@ -606,13 +606,13 @@ static inline unsigned int ipv6_advmss(unsigned int mtu)
mtu
=
ip6_rt_min_advmss
;
mtu
=
ip6_rt_min_advmss
;
/*
/*
* Maximal non-jumbo IPv6 payload is
65535
and
* Maximal non-jumbo IPv6 payload is
IPV6_MAXPLEN
and
* corresponding MSS is
65535
- tcp_header_size.
* corresponding MSS is
IPV6_MAXPLEN
- tcp_header_size.
*
65535
is also valid and means: "any MSS,
*
IPV6_MAXPLEN
is also valid and means: "any MSS,
* rely only on pmtu discovery"
* rely only on pmtu discovery"
*/
*/
if
(
mtu
>
65535
-
sizeof
(
struct
tcphdr
))
if
(
mtu
>
IPV6_MAXPLEN
-
sizeof
(
struct
tcphdr
))
mtu
=
65535
;
mtu
=
IPV6_MAXPLEN
;
return
mtu
;
return
mtu
;
}
}
...
...
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