Skip to content

Commit 069a813

Browse files
committed
Merge branch 'hotfix/v3.1.3'
2 parents bfa6ff1 + 6411bf0 commit 069a813

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

Ethernet/socket.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,12 @@ int32_t sendto(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t
496496
switch(getSn_MR(sn) & 0x0F)
497497
{
498498
case Sn_MR_UDP:
499-
case Sn_MR_IPRAW:
500499
case Sn_MR_MACRAW:
501500
break;
501+
#if ( _WIZCHIP_ < 5200 )
502+
case Sn_MR_IPRAW:
503+
break;
504+
#endif
502505
default:
503506
return SOCKERR_SOCKMODE;
504507
}
@@ -514,10 +517,14 @@ int32_t sendto(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t
514517
//}
515518
//
516519
//if(*((uint32_t*)addr) == 0) return SOCKERR_IPINVALID;
517-
if((taddr == 0)&(getSn_MR(sn)&Sn_MR_MACRAW != Sn_MR_MACRAW)) return SOCKERR_IPINVALID;
518-
if((port == 0)&(getSn_MR(sn)&Sn_MR_MACRAW != Sn_MR_MACRAW)) return SOCKERR_PORTZERO;
520+
if((taddr == 0) && (getSn_MR(sn)&Sn_MR_MACRAW != Sn_MR_MACRAW)) return SOCKERR_IPINVALID;
521+
if((port == 0) && (getSn_MR(sn)&Sn_MR_MACRAW != Sn_MR_MACRAW)) return SOCKERR_PORTZERO;
519522
tmp = getSn_SR(sn);
523+
#if ( _WIZCHIP_ < 5200 )
520524
if(tmp != SOCK_MACRAW && tmp != SOCK_UDP && tmp != SOCK_IPRAW) return SOCKERR_SOCKSTATUS;
525+
#else
526+
if(tmp != SOCK_MACRAW && tmp != SOCK_UDP) return SOCKERR_SOCKSTATUS;
527+
#endif
521528

522529
setSn_DIPR(sn,addr);
523530
setSn_DPORT(sn,port);
@@ -909,7 +916,11 @@ int8_t getsockopt(uint8_t sn, sockopt_type sotype, void* arg)
909916
*(uint16_t*)arg = sock_remained_size[sn];
910917
break;
911918
case SO_PACKINFO:
912-
CHECK_SOCKMODE(Sn_MR_TCP);
919+
//CHECK_SOCKMODE(Sn_MR_TCP);
920+
#if _WIZCHIP_ != 5300
921+
if((getSn_MR(sn) == Sn_MR_TCP))
922+
return SOCKERR_SOCKMODE;
923+
#endif
913924
*(uint8_t*)arg = sock_pack_info[sn];
914925
break;
915926
default:

license.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Copyright (c) 2014 WIZnet Co.,Ltd.
3+
Copyright (c) WIZnet ioLibrary Project.
4+
All rights reserved.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

0 commit comments

Comments
 (0)