Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
47
Issues
47
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
e1cc21b2
Commit
e1cc21b2
authored
Feb 26, 2012
by
Alessandro Rubini
Committed by
Aurelio Colosimo
Mar 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initialization: fix clockId setup
parent
740f97e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
posix-socket.c
arch-gnu-linux/posix-socket.c
+2
-2
state-initializing.c
proto-standard/state-initializing.c
+14
-4
No files found.
arch-gnu-linux/posix-socket.c
View file @
e1cc21b2
...
...
@@ -209,13 +209,13 @@ int posix_open_ch(struct pp_instance *ppi, char *ifname, int chtype)
return
-
1
;
}
memcpy
(
NP
(
ppi
)
->
ch
[
chtype
].
addr
,
ifr
.
ifr_hwaddr
.
sa_data
,
6
);
if
(
ioctl
(
sock
,
SIOCGIFADDR
,
&
ifr
)
<
0
)
{
pp_diag_error_str2
(
ppi
,
"SIOCGIFADDR"
,
strerror
(
errno
));
return
-
1
;
}
memcpy
(
NP
(
ppi
)
->
ch
[
chtype
].
addr
,
ifr
.
ifr_hwaddr
.
sa_data
,
6
);
iface_addr
.
s_addr
=
((
struct
sockaddr_in
*
)
&
ifr
.
ifr_addr
)
->
sin_addr
.
s_addr
;
...
...
proto-standard/state-initializing.c
View file @
e1cc21b2
...
...
@@ -12,6 +12,8 @@
int
pp_initializing
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
unsigned
char
*
id
,
*
mac
;
pp_net_shutdown
(
ppi
);
if
(
pp_net_init
(
ppi
)
<
0
)
...
...
@@ -19,10 +21,18 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
/* Initialize default data set */
DSDEF
(
ppi
)
->
twoStepFlag
=
PP_TWO_STEP_FLAG
;
pp_memcpy
(
DSDEF
(
ppi
)
->
clockIdentity
,
NP
(
ppi
)
->
ch
[
PP_NP_GEN
].
addr
,
PP_CLOCK_IDENTITY_LENGTH
);
DSDEF
(
ppi
)
->
clockIdentity
[
3
]
=
0xff
;
DSDEF
(
ppi
)
->
clockIdentity
[
4
]
=
0xfe
;
/* Clock identity comes from mac address with 0xff:0xfe intermixed */
id
=
DSDEF
(
ppi
)
->
clockIdentity
;
mac
=
NP
(
ppi
)
->
ch
[
PP_NP_GEN
].
addr
;
id
[
0
]
=
mac
[
0
];
id
[
1
]
=
mac
[
1
];
id
[
2
]
=
mac
[
2
];
id
[
3
]
=
0xff
;
id
[
4
]
=
0xfe
;
id
[
5
]
=
mac
[
3
];
id
[
6
]
=
mac
[
4
];
id
[
7
]
=
mac
[
5
];
DSDEF
(
ppi
)
->
numberPorts
=
1
;
pp_memcpy
(
&
DSDEF
(
ppi
)
->
clockQuality
,
&
OPTS
(
ppi
)
->
clock_quality
,
sizeof
(
ClockQuality
));
...
...
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