Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
1b7d4743
Commit
1b7d4743
authored
Feb 14, 2011
by
Daniel Lezcano
Committed by
Daniel Lezcano
Feb 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify broadcast computation
David Ward reported this computation could be written in a simpler way. Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
955f4ce6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
confile.c
src/lxc/confile.c
+3
-2
No files found.
src/lxc/confile.c
View file @
1b7d4743
...
@@ -423,8 +423,9 @@ static int config_network_ipv4(const char *key, char *value,
...
@@ -423,8 +423,9 @@ static int config_network_ipv4(const char *key, char *value,
* prefix and address
* prefix and address
*/
*/
if
(
!
bcast
)
{
if
(
!
bcast
)
{
int
mask
=
htonl
(
INADDR_BROADCAST
<<
(
32
-
inetdev
->
prefix
));
inetdev
->
bcast
.
s_addr
=
inetdev
->
addr
.
s_addr
;
inetdev
->
bcast
.
s_addr
=
(
inetdev
->
addr
.
s_addr
&
mask
)
|
~
mask
;
inetdev
->
bcast
.
s_addr
|=
htonl
(
INADDR_BROADCAST
>>
inetdev
->
prefix
);
}
}
lxc_list_add
(
&
netdev
->
ipv4
,
list
);
lxc_list_add
(
&
netdev
->
ipv4
,
list
);
...
...
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