tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: RFC: ipsec(4) pseudo interface



In article <e5721d0b-1b44-612e-a23c-ca5e2af5228a%iij.ad.jp@localhost>,
Kengo NAKAHARA  <k-nakahara%iij.ad.jp@localhost> wrote:
>Hi,
>
>Thank you for your reviewing.


Thanks for fixing; more nit-picking:
1. there is a variable called err instead of error why (all the rest
   are called error)?
2. I prefer fewer lines of code, fewer variables for all the copies
   of those similar functions, like:

+static int
+if_ipsec_encap_detach(struct ipsec_variant *var)
+{
+
+	KASSERT(var != NULL);
+	KASSERT(if_ipsec_variant_is_configured(var));
+
+	switch (var->iv_psrc->sa_family) {
+#ifdef INET
+	case AF_INET:
+		return ipsecif4_detach(var);
+#endif /* INET */
+#ifdef INET6
+	case AF_INET6:
+		return ipsecif6_detach(var);
+		break;
+#endif /* INET6 */
+	default:
+		return EINVAL;
+	}
+}

Best,

christos



Home | Main Index | Thread Index | Old Index