Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
b65c513d
Commit
b65c513d
authored
Jan 14, 2016
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: create_socket: allow addr to be NULL
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
15e0cd25
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
ipv4.c
lib/ipv4.c
+3
-4
net.c
lib/net.c
+3
-1
No files found.
lib/ipv4.c
View file @
b65c513d
...
...
@@ -71,16 +71,15 @@ void ipv4_init(void)
needIP
=
1
;
/* Bootp: use UDP engine activated but function arguments */
memset
(
&
saddr
,
0
,
sizeof
(
saddr
));
bootp_socket
=
ptpd_netif_create_socket
(
&
__static_bootp_socket
,
&
saddr
,
bootp_socket
=
ptpd_netif_create_socket
(
&
__static_bootp_socket
,
NULL
,
PTPD_SOCK_UDP
,
68
/* bootpc */
);
/* time (rdate): UDP */
rdate_socket
=
ptpd_netif_create_socket
(
&
__static_rdate_socket
,
&
saddr
,
rdate_socket
=
ptpd_netif_create_socket
(
&
__static_rdate_socket
,
NULL
,
PTPD_SOCK_UDP
,
37
/* time */
);
/* ICMP: specify raw (not UDP), with IPV4 ethtype */
memset
(
&
saddr
,
0
,
sizeof
(
saddr
));
saddr
.
ethertype
=
htons
(
0x0800
);
icmp_socket
=
ptpd_netif_create_socket
(
&
__static_icmp_socket
,
&
saddr
,
PTPD_SOCK_RAW_ETHERNET
,
0
);
...
...
lib/net.c
View file @
b65c513d
...
...
@@ -75,6 +75,8 @@ struct wrpc_socket *ptpd_netif_create_socket(struct wrpc_socket *sock,
return
NULL
;
/* copy and complete the bind information. If MAC is 0 use unicast */
memset
(
&
sock
->
bind_addr
,
0
,
sizeof
(
struct
wr_sockaddr
));
if
(
bind_addr
)
memcpy
(
&
sock
->
bind_addr
,
bind_addr
,
sizeof
(
struct
wr_sockaddr
));
if
(
!
memcmp
(
sock
->
bind_addr
.
mac
,
zero_mac
,
ETH_ALEN
))
get_mac_addr
(
sock
->
bind_addr
.
mac
);
...
...
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