Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
fa27514f
Commit
fa27514f
authored
Apr 02, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect against incorrect MTU values.
parent
3f282bd1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
network.c
network.c
+11
-0
No files found.
network.c
View file @
fa27514f
...
@@ -196,6 +196,17 @@ network_up(struct network *net, int up)
...
@@ -196,6 +196,17 @@ network_up(struct network *net, int up)
net
->
ifname
,
net
->
ifindex
);
net
->
ifname
,
net
->
ifindex
);
mtu
=
1280
;
mtu
=
1280
;
}
}
/* We need to be able to fit at least two messages into a packet,
so MTUs below 116 require lower layer fragmentation. */
/* In IPv6, the minimum MTU is 1280, and every host must be able
to reassemble up to 1500 bytes, but I'd rather not rely on this. */
if
(
mtu
<
128
)
{
fprintf
(
stderr
,
"Suspiciously low MTU %d on interface %s (%d).
\n
"
,
mtu
,
net
->
ifname
,
net
->
ifindex
);
mtu
=
128
;
}
/* 40 for IPv6 header, 8 for UDP header, 12 for good luck. */
/* 40 for IPv6 header, 8 for UDP header, 12 for good luck. */
mtu
-=
60
;
mtu
-=
60
;
...
...
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