Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
812cf62f
Commit
812cf62f
authored
Aug 31, 2014
by
Damien George
Browse files
drivers, wiznet5k: Fix IP addr verification.
parent
71224cb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
drivers/wiznet5k/ethernet/socket.c
View file @
812cf62f
...
...
@@ -195,8 +195,8 @@ int8_t connect(uint8_t sn, uint8_t * addr, uint16_t port)
taddr
=
((
uint32_t
)
addr
[
0
]
&
0x000000FF
);
taddr
=
(
taddr
<<
8
)
+
((
uint32_t
)
addr
[
1
]
&
0x000000FF
);
taddr
=
(
taddr
<<
8
)
+
((
uint32_t
)
addr
[
2
]
&
0x000000FF
);
taddr
=
(
taddr
<<
8
)
+
((
uint32_t
)
addr
[
0
]
&
0x000000FF
);
if
(
taddr
==
0xFFFFFFFF
||
taddr
==
0
)
return
SOCKERR_IPINVALID
;
taddr
=
(
taddr
<<
8
)
+
((
uint32_t
)
addr
[
3
]
&
0x000000FF
);
if
(
taddr
==
0xFFFFFFFF
||
taddr
==
0
)
return
SOCKERR_IPINVALID
;
}
//
...
...
@@ -369,9 +369,9 @@ int32_t sendto(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t
taddr
=
(
taddr
<<
8
)
+
((
uint32_t
)
addr
[
1
]
&
0x000000FF
);
taddr
=
(
taddr
<<
8
)
+
((
uint32_t
)
addr
[
2
]
&
0x000000FF
);
taddr
=
(
taddr
<<
8
)
+
((
uint32_t
)
addr
[
3
]
&
0x000000FF
);
if
(
taddr
==
0xFFFFFFFF
||
taddr
==
0
)
return
SOCKERR_IPINVALID
;
}
//
if
(
*
((
uint32_t
*
)
addr
)
==
0
)
return
SOCKERR_IPINVALID
;
if
(
port
==
0
)
return
SOCKERR_PORTZERO
;
tmp
=
getSn_SR
(
sn
);
if
(
tmp
!=
SOCK_MACRAW
&&
tmp
!=
SOCK_UDP
)
return
SOCKERR_SOCKSTATUS
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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