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
28
Issues
28
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
b0213b1d
Commit
b0213b1d
authored
Jul 04, 2012
by
Wesley W. Terpstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't cache the MAC address; it can be changed from shell.
parent
3a22075c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
4 deletions
+2
-4
arp.c
lib/arp.c
+1
-1
icmp.c
lib/icmp.c
+1
-1
ipv4.c
lib/ipv4.c
+0
-2
No files found.
lib/arp.c
View file @
b0213b1d
...
...
@@ -58,7 +58,7 @@ static int process_arp(uint8_t* buf, int len) {
buf
[
ARP_OPER
+
0
]
=
0
;
buf
[
ARP_OPER
+
1
]
=
2
;
// my MAC+IP
memcpy
(
buf
+
ARP_SHA
,
myMAC
,
6
);
get_mac_addr
(
buf
+
ARP_SHA
);
memcpy
(
buf
+
ARP_SPA
,
myIP
,
4
);
// his MAC+IP
memcpy
(
buf
+
ARP_THA
,
hisMAC
,
6
);
...
...
lib/icmp.c
View file @
b0213b1d
...
...
@@ -28,7 +28,7 @@ void icmp_init(const char* if_name) {
/* Configure socket filter */
memset
(
&
saddr
,
0
,
sizeof
(
saddr
));
strcpy
(
saddr
.
if_name
,
if_name
);
memcpy
(
&
saddr
.
mac
,
myMAC
,
6
);
/* Unicast */
get_mac_addr
(
&
saddr
.
mac
);
/* Unicast */
saddr
.
ethertype
=
htons
(
0x0800
);
/* IPv4 */
saddr
.
family
=
PTPD_SOCK_RAW_ETHERNET
;
...
...
lib/ipv4.c
View file @
b0213b1d
...
...
@@ -3,7 +3,6 @@
#include "endpoint.h"
#include "ipv4.h"
uint8_t
myMAC
[
6
];
uint8_t
myIP
[
4
];
unsigned
int
ipv4_checksum
(
unsigned
short
*
buf
,
int
shorts
)
{
...
...
@@ -25,7 +24,6 @@ void ipv4_init(const char* if_name, uint32_t ip) {
ip_bigendian
=
htonl
(
ip
);
memcpy
(
myIP
,
&
ip_bigendian
,
4
);
get_mac_addr
(
myMAC
);
arp_init
(
if_name
);
icmp_init
(
if_name
);
...
...
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