-/* $OpenBSD: uipc_socket.c,v 1.10 1997/02/28 03:20:38 angelos Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.11 1997/02/28 04:03:45 angelos Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
#define SOMINCONN 80
#endif /* SOMINCONN */
-extern u_char ipsec_auth_default_level;
-extern u_char ipsec_esp_trans_default_level;
-extern u_char ipsec_esp_network_default_level;
-
int somaxconn = SOMAXCONN;
int sominconn = SOMINCONN;
so->so_state = SS_PRIV;
so->so_uid = p->p_ucred->cr_uid;
so->so_proto = prp;
- so->so_seclevel[SL_AUTH] = ipsec_auth_default_level;
- so->so_seclevel[SL_ESP_TRANS] = ipsec_esp_trans_default_level;
- so->so_seclevel[SL_ESP_NETWORK] = ipsec_esp_network_default_level;
error =
(*prp->pr_usrreq)(so, PRU_ATTACH, NULL, (struct mbuf *)(long)proto,
NULL);
panic("sofree dq");
so->so_head = 0;
}
-#ifdef IPSEC
- /* XXX Free TDBs/routing entries if necessary */
-#endif
sbrelease(&so->so_snd);
sorflush(so);
FREE(so, M_SOCKET);
-/* $OpenBSD: in_pcb.c,v 1.14 1997/02/05 15:48:23 deraadt Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.15 1997/02/28 04:03:47 angelos Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
struct in_addr zeroin_addr;
+extern u_char ipsec_auth_default_level;
+extern u_char ipsec_esp_trans_default_level;
+extern u_char ipsec_esp_network_default_level;
+
/*
* These configure the range of local port addresses assigned to
* "unspecified" outgoing connections/packets/whatever.
bzero((caddr_t)inp, sizeof(*inp));
inp->inp_table = table;
inp->inp_socket = so;
+ inp->inp_seclevel[SL_AUTH] = ipsec_auth_default_level;
+ inp->inp_seclevel[SL_ESP_TRANS] = ipsec_esp_trans_default_level;
+ inp->inp_seclevel[SL_ESP_NETWORK] = ipsec_esp_network_default_level;
s = splnet();
CIRCLEQ_INSERT_HEAD(&table->inpt_queue, inp, inp_queue);
LIST_INSERT_HEAD(INPCBHASH(table, &inp->inp_faddr, inp->inp_fport,
if (inp->inp_route.ro_rt)
rtfree(inp->inp_route.ro_rt);
ip_freemoptions(inp->inp_moptions);
+#ifdef IPSEC
+ /* XXX IPsec cleanup here */
+#endif
s = splnet();
LIST_REMOVE(inp, inp_hash);
CIRCLEQ_REMOVE(&inp->inp_table->inpt_queue, inp, inp_queue);
-/* $OpenBSD: in_pcb.h,v 1.3 1996/07/29 02:34:30 downsj Exp $ */
+/* $OpenBSD: in_pcb.h,v 1.4 1997/02/28 04:03:48 angelos Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
struct ip inp_ip; /* header prototype; should have more */
struct mbuf *inp_options; /* IP options */
struct ip_moptions *inp_moptions; /* IP multicast options */
+ u_char inp_seclevel[4]; /* Only the first 3 are used for now */
+#define SL_AUTH 0 /* Authentication level */
+#define SL_ESP_TRANS 1 /* ESP transport level */
+#define SL_ESP_NETWORK 2 /* ESP network (encapsulation) level */
};
struct inpcbtable {
-/* $OpenBSD: ip_output.c,v 1.8 1997/02/28 03:44:54 angelos Exp $ */
+/* $OpenBSD: ip_output.c,v 1.9 1997/02/28 04:03:48 angelos Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
switch (optname) {
case IP_AUTH_LEVEL:
- so->so_seclevel[SL_AUTH] = optval;
+ inp->inp_seclevel[SL_AUTH] = optval;
break;
case IP_ESP_TRANS_LEVEL:
- so->so_seclevel[SL_ESP_TRANS] = optval;
+ inp->inp_seclevel[SL_ESP_TRANS] = optval;
break;
case IP_ESP_NETWORK_LEVEL:
- so->so_seclevel[SL_ESP_NETWORK] = optval;
+ inp->inp_seclevel[SL_ESP_NETWORK] = optval;
break;
}
#else
switch (optname) {
case IP_AUTH_LEVEL:
- optval = so->so_seclevel[SL_AUTH];
+ optval = inp->inp_seclevel[SL_AUTH];
break;
case IP_ESP_TRANS_LEVEL:
- optval = so->so_seclevel[SL_ESP_TRANS];
+ optval = inp->inp_seclevel[SL_ESP_TRANS];
break;
case IP_ESP_NETWORK_LEVEL:
- optval = so->so_seclevel[SL_ESP_NETWORK];
+ optval = inp->inp_seclevel[SL_ESP_NETWORK];
break;
}