Subject: Re: netinet compilation warnings with IPv6 code, but without INET6
To: Erik Bertelsen <erik@mediator.uni-c.dk>
From: None <itojun@iijlab.net>
List: tech-net
Date: 07/02/1999 19:42:05
>On my pmax, I observed the kernel problems shown below while compiling
>a kernel based on yesterday's sources. It does not contain any of the
>new IPv6 options (e.g. INET6):
Thanks for the report, does it work for you?
itojun
Index: tcp_input.c
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/tcp_input.c,v
retrieving revision 1.83
diff -c -r1.83 tcp_input.c
*** tcp_input.c 1999/07/01 08:12:51 1.83
--- tcp_input.c 1999/07/02 10:39:04
***************
*** 3215,3220 ****
--- 3215,3222 ----
th->th_sport = sc->sc_dst.sin6.sin6_port;
break;
#endif
+ default:
+ th = NULL;
}
th->th_seq = htonl(sc->sc_iss);
***************
*** 3327,3332 ****
--- 3329,3337 ----
0, NULL);
break;
#endif
+ default:
+ error = EAFNOSUPPORT;
+ break;
}
return (error);
}
Index: tcp_output.c
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/tcp_output.c,v
retrieving revision 1.48
diff -c -r1.48 tcp_output.c
*** tcp_output.c 1999/07/01 08:12:51 1.48
--- tcp_output.c 1999/07/02 10:39:06
***************
*** 584,589 ****
--- 584,592 ----
iphdrlen = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
break;
#endif
+ default: /*pacify gcc*/
+ iphdrlen = 0;
+ break;
}
hdrlen = iphdrlen;
if (flags & TH_SYN) {
***************
*** 768,773 ****
--- 771,781 ----
th = (struct tcphdr *)(ip6 + 1);
break;
#endif
+ default: /*pacify gcc*/
+ ip = NULL;
+ ip6 = NULL;
+ th = NULL;
+ break;
}
if (tp->t_template == 0)
panic("tcp_output");
***************
*** 1062,1067 ****
--- 1070,1078 ----
break;
}
#endif
+ default:
+ error = EAFNOSUPPORT;
+ break;
}
if (error) {
out:
Index: tcp_subr.c
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/tcp_subr.c,v
retrieving revision 1.67
diff -c -r1.67 tcp_subr.c
*** tcp_subr.c 1999/07/01 08:12:51 1.67
--- tcp_subr.c 1999/07/02 10:39:08
***************
*** 256,261 ****
--- 256,262 ----
return NULL; /*EINVAL*/
#endif
default:
+ hlen = 0; /*pacify gcc*/
return NULL; /*EAFNOSUPPORT*/
}
if ((m = tp->t_template) == 0) {
***************
*** 444,449 ****
--- 445,455 ----
th = (struct tcphdr *)(ip6 + 1);
break;
#endif
+ default: /*pacify gcc*/
+ ip = NULL;
+ ip6 = NULL;
+ th = NULL;
+ break;
}
flags = TH_ACK;
} else {
***************
*** 653,658 ****
--- 659,667 ----
error = ip6_output(m, NULL, (struct route_in6 *)ro, 0, NULL);
break;
#endif
+ default:
+ error = EAFNOSUPPORT;
+ break;
}
if (ro == (struct route *)&iproute) {
Index: tcp_usrreq.c
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/tcp_usrreq.c,v
retrieving revision 1.40
diff -c -r1.40 tcp_usrreq.c
*** tcp_usrreq.c 1999/07/01 08:12:51 1.40
--- tcp_usrreq.c 1999/07/02 10:39:10
***************
*** 746,751 ****
--- 746,753 ----
else if (in6p)
tp = tcp_newtcpcb(family, (void *)in6p);
#endif
+ else
+ tp = NULL;
if (tp == 0) {
int nofd = so->so_state & SS_NOFDREF; /* XXX */