Skip to content

Commit 3011f0a

Browse files
hmfhmfhefloryd
authored andcommitted
Check that socket was successfully created
1 parent 2987449 commit 3011f0a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

oshw/linux/nicdrv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
144144
}
145145
/* we use RAW packet socket, with packet type ETH_P_ECAT */
146146
*psock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ECAT));
147+
if(*psock < 0)
148+
return 0;
147149

148150
timeout.tv_sec = 0;
149151
timeout.tv_usec = 1;

0 commit comments

Comments
 (0)