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
75084871
Commit
75084871
authored
Apr 08, 2009
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default values for interface flags from net->conf.
parent
b6513124
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
network.c
network.c
+23
-4
network.h
network.h
+7
-0
No files found.
network.c
View file @
75084871
...
@@ -244,6 +244,10 @@ network_up(struct network *net, int up)
...
@@ -244,6 +244,10 @@ network_up(struct network *net, int up)
if
(
all_wireless
)
{
if
(
all_wireless
)
{
wired
=
0
;
wired
=
0
;
}
else
if
(
NET_CONF
(
net
,
wired
)
==
CONFIG_NO
)
{
wired
=
0
;
}
else
if
(
NET_CONF
(
net
,
wired
)
==
CONFIG_YES
)
{
wired
=
1
;
}
else
{
}
else
{
rc
=
kernel_interface_wireless
(
net
->
ifname
,
net
->
ifindex
);
rc
=
kernel_interface_wireless
(
net
->
ifname
,
net
->
ifindex
);
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
...
@@ -261,14 +265,29 @@ network_up(struct network *net, int up)
...
@@ -261,14 +265,29 @@ network_up(struct network *net, int up)
net
->
flags
|=
NET_WIRED
;
net
->
flags
|=
NET_WIRED
;
net
->
cost
=
NET_CONF
(
net
,
cost
);
net
->
cost
=
NET_CONF
(
net
,
cost
);
if
(
net
->
cost
<=
0
)
net
->
cost
=
96
;
if
(
net
->
cost
<=
0
)
net
->
cost
=
96
;
if
(
split_horizon
)
if
(
NET_CONF
(
net
,
split_horizon
)
==
CONFIG_NO
)
net
->
flags
&=
~
NET_SPLIT_HORIZON
;
else
if
(
NET_CONF
(
net
,
split_horizon
)
==
CONFIG_YES
)
net
->
flags
|=
NET_SPLIT_HORIZON
;
else
if
(
split_horizon
)
net
->
flags
|=
NET_SPLIT_HORIZON
;
net
->
flags
|=
NET_SPLIT_HORIZON
;
else
net
->
flags
&=
~
NET_SPLIT_HORIZON
;
if
(
NET_CONF
(
net
,
lq
)
==
CONFIG_YES
)
net
->
flags
|=
NET_LQ
;
else
net
->
flags
&=
~
NET_LQ
;
net
->
flags
&=
~
NET_LQ
;
}
else
{
}
else
{
net
->
flags
&=
~
NET_WIRED
;
net
->
flags
&=
~
NET_WIRED
;
net
->
cost
=
NET_CONF
(
net
,
cost
);
net
->
cost
=
NET_CONF
(
net
,
cost
);
if
(
net
->
cost
<=
0
)
net
->
cost
=
256
;
if
(
net
->
cost
<=
0
)
net
->
cost
=
256
;
if
(
NET_CONF
(
net
,
split_horizon
)
==
CONFIG_YES
)
net
->
flags
|=
NET_SPLIT_HORIZON
;
else
net
->
flags
&=
~
NET_SPLIT_HORIZON
;
net
->
flags
&=
~
NET_SPLIT_HORIZON
;
if
(
NET_CONF
(
net
,
lq
)
==
CONFIG_NO
)
net
->
flags
&=
~
NET_LQ
;
else
net
->
flags
|=
NET_LQ
;
net
->
flags
|=
NET_LQ
;
}
}
update_hello_interval
(
net
);
update_hello_interval
(
net
);
...
...
network.h
View file @
75084871
...
@@ -31,9 +31,16 @@ struct network_conf {
...
@@ -31,9 +31,16 @@ struct network_conf {
char
*
ifname
;
char
*
ifname
;
unsigned
short
cost
;
unsigned
short
cost
;
unsigned
short
hello_interval
;
unsigned
short
hello_interval
;
char
wired
;
char
split_horizon
;
char
lq
;
struct
network_conf
*
next
;
struct
network_conf
*
next
;
};
};
#define CONFIG_DEFAULT 0
#define CONFIG_NO 1
#define CONFIG_YES 2
#define NET_UP (1 << 0)
#define NET_UP (1 << 0)
#define NET_WIRED (1<<1)
#define NET_WIRED (1<<1)
#define NET_SPLIT_HORIZON (1 << 2)
#define NET_SPLIT_HORIZON (1 << 2)
...
...
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