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
39a823c5
Commit
39a823c5
authored
Mar 10, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mac OS X fixes.
At least it compiles now.
parent
0d5b693c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
kernel_socket.c
kernel_socket.c
+15
-3
No files found.
kernel_socket.c
View file @
39a823c5
...
@@ -226,13 +226,18 @@ int
...
@@ -226,13 +226,18 @@ int
kernel_interface_operational
(
const
char
*
ifname
,
int
ifindex
)
kernel_interface_operational
(
const
char
*
ifname
,
int
ifindex
)
{
{
struct
ifreq
req
;
struct
ifreq
req
;
int
rc
;
int
s
,
rc
;
int
flags
=
link_detect
?
(
IFF_UP
|
IFF_RUNNING
)
:
IFF_UP
;
int
flags
=
link_detect
?
(
IFF_UP
|
IFF_RUNNING
)
:
IFF_UP
;
s
=
socket
(
PF_INET
,
SOCK_DGRAM
,
0
);
if
(
s
<
0
)
return
-
1
;
memset
(
&
req
,
0
,
sizeof
(
req
));
memset
(
&
req
,
0
,
sizeof
(
req
));
memset
(
&
req
,
0
,
sizeof
(
req
));
memset
(
&
req
,
0
,
sizeof
(
req
));
strncpy
(
req
.
ifr_name
,
ifname
,
sizeof
(
req
.
ifr_name
));
strncpy
(
req
.
ifr_name
,
ifname
,
sizeof
(
req
.
ifr_name
));
rc
=
ioctl
(
dgram_socket
,
SIOCGIFFLAGS
,
&
req
);
rc
=
ioctl
(
s
,
SIOCGIFFLAGS
,
&
req
);
close
(
s
);
if
(
rc
<
0
)
if
(
rc
<
0
)
return
-
1
;
return
-
1
;
return
((
req
.
ifr_flags
&
flags
)
==
flags
);
return
((
req
.
ifr_flags
&
flags
)
==
flags
);
...
@@ -252,8 +257,8 @@ kernel_interface_ipv4(const char *ifname, int ifindex, unsigned char *addr_r)
...
@@ -252,8 +257,8 @@ kernel_interface_ipv4(const char *ifname, int ifindex, unsigned char *addr_r)
strncpy
(
req
.
ifr_name
,
ifname
,
sizeof
(
req
.
ifr_name
));
strncpy
(
req
.
ifr_name
,
ifname
,
sizeof
(
req
.
ifr_name
));
req
.
ifr_addr
.
sa_family
=
AF_INET
;
req
.
ifr_addr
.
sa_family
=
AF_INET
;
rc
=
ioctl
(
s
,
SIOCGIFADDR
,
&
req
);
rc
=
ioctl
(
s
,
SIOCGIFADDR
,
&
req
);
if
(
rc
<
0
)
{
close
(
s
);
close
(
s
);
if
(
rc
<
0
)
{
return
-
1
;
return
-
1
;
}
}
...
@@ -594,6 +599,13 @@ socket_read(int sock)
...
@@ -594,6 +599,13 @@ socket_read(int sock)
}
}
int
kernel_addresses
(
struct
kernel_route
*
routes
,
int
maxroutes
)
{
errno
=
ENOSYS
;
return
-
1
;
}
int
int
kernel_callback
(
int
(
*
fn
)(
int
,
void
*
),
void
*
closure
)
kernel_callback
(
int
(
*
fn
)(
int
,
void
*
),
void
*
closure
)
{
{
...
...
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