DPADD+= ${LIBCHARDRIVER} ${LIBSYS} ${LIBMINIXUTIL}
LDADD+= -lchardriver -lsys -lminixutil
+.if ${COMPILER_TYPE} == "gnu"
+LDADD+= -lc
+.endif
+
MAN=
BINDIR?= /usr/sbin
-CPPFLAGS+= -I${.CURDIR} -D_MINIX
+CPPFLAGS+= -I${.CURDIR} -D_MINIX -Wall -Werror
.include <minix.service.mk>
* the underlying buffer.
*/
-#define ptr2acc_data(/* acc_t * */ a) (bf_temporary_acc=(a), \
- (&bf_temporary_acc->acc_buffer->buf_data_p[bf_temporary_acc-> \
- acc_offset]))
+#define ptr2acc_data(/* acc_t * */ a) (&((acc_t *)(a))->acc_buffer-> \
+ buf_data_p[((acc_t *)(a))->acc_offset])
#define bf_chkbuf(buf) ((buf)? (compare((buf)->acc_linkC,>,0), \
compare((buf)->acc_buffer, !=, 0), \
if (tcp_hdr_flags & THF_ACK)
{
if (tcp_LEmod4G(seg_ack, tcp_conn->tc_ISS) ||
- tcp_Gmod4G(seg_ack, tcp_conn->tc_SND_NXT))
+ tcp_Gmod4G(seg_ack, tcp_conn->tc_SND_NXT)) {
if (tcp_hdr_flags & THF_RST)
break;
else
tcp_conn_write(tcp_conn, 1);
break;
}
+ }
acceptable_ACK= (tcp_LEmod4G(tcp_conn->tc_SND_UNA,
seg_ack) && tcp_LEmod4G(seg_ack,
tcp_conn->tc_SND_NXT));
result= (*udp_fd->uf_put_userdata)(udp_fd->uf_srfd,
(size_t)0, pack, FALSE);
- if (result >= 0)
+ if (result >= 0) {
if (size > transf_size)
result= EPACKSIZE;
else
result= transf_size;
+ }
udp_fd->uf_flags &= ~UFF_READ_IP;
result= (*udp_fd->uf_put_userdata)(udp_fd->uf_srfd, result,
void read_conf(void)
{
- int i, j, ifno, type, port, enable;
+ int i, j, ifno = -1, type = -1, port = -1, enable;
struct eth_conf *ecp;
struct psip_conf *pcp;
struct ip_conf *icp;
}
ecp++;
eth_conf_nr++;
- } else
- if (strncmp(word, "psip", 4) == 0) {
+ } else if (strncmp(word, "psip", 4) == 0) {
pcp->pc_ifno= ifno= number(word+4, IP_PORT_MAX-1);
type= NETTYPE_PSIP;
port= psip_conf_nr;
printf("inet: Unknown device '%s'\n", word);
error();
}
+
+ if (type == -1 || ifno == -1 || port == -1) {
+ printf("inet: faulty configuration\n");
+ exit(1);
+ }
+
iftype[ifno]= type;
icp->ic_ifno= ifno;
icp->ic_devtype= type;
mq_t *m;
{
int result;
- int send_reply, free_mess;
+ int send_reply = 0, free_mess = 0;
if (repl_queue)
{