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
8aea90e5
Commit
8aea90e5
authored
Jul 15, 2011
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace some impossible cases with assertions.
Noted by Matthieu Boutier.
parent
1e0087be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
network.c
network.c
+5
-5
No files found.
network.c
View file @
8aea90e5
...
...
@@ -23,6 +23,7 @@ THE SOFTWARE.
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
...
...
@@ -60,14 +61,13 @@ add_network(char *ifname, struct network_conf *conf)
{
struct
network
*
net
;
if
(
conf
)
{
if
(
strcmp
(
ifname
,
conf
->
ifname
)
!=
0
)
return
NULL
;
}
assert
(
!
conf
||
strcmp
(
ifname
,
conf
->
ifname
)
==
0
);
FOR_ALL_NETS
(
net
)
{
if
(
strcmp
(
net
->
ifname
,
ifname
)
==
0
)
if
(
strcmp
(
net
->
ifname
,
ifname
)
==
0
)
{
assert
(
conf
==
NULL
);
return
net
;
}
}
net
=
malloc
(
sizeof
(
struct
network
));
...
...
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