Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec Remove duplicate, to better show that this plac...



details:   https://anonhg.NetBSD.org/src/rev/01b3ffe1f62a
branches:  trunk
changeset: 831776:01b3ffe1f62a
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Apr 13 09:34:20 2018 +0000

description:
Remove duplicate, to better show that this place doesn't make a lot of
sense. The code should probably be removed, it's a leftover from when we
had #ifdef __FreeBSD__.

diffstat:

 sys/netipsec/xform_ah.c |  21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diffs (45 lines):

diff -r 47709e872e21 -r 01b3ffe1f62a sys/netipsec/xform_ah.c
--- a/sys/netipsec/xform_ah.c   Fri Apr 13 09:29:04 2018 +0000
+++ b/sys/netipsec/xform_ah.c   Fri Apr 13 09:34:20 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform_ah.c,v 1.87 2018/02/26 06:40:08 maxv Exp $       */
+/*     $NetBSD: xform_ah.c,v 1.88 2018/04/13 09:34:20 maxv Exp $       */
 /*     $FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $   */
 /*     $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
 /*
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.87 2018/02/26 06:40:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.88 2018/04/13 09:34:20 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -310,20 +310,15 @@
                 * whereas on NetBSD, we should not.
                 */
                if (!out) {
+                       /* XXX XXX: What are we trying to achieve here? */
                        uint16_t inlen = ntohs(ip->ip_len);
-
                        ip->ip_len = htons(inlen);
+               }
 
-                       if (alg == CRYPTO_MD5_KPDK || alg == CRYPTO_SHA1_KPDK)
-                               ip->ip_off  &= htons(IP_DF);
-                       else
-                               ip->ip_off = 0;
-               } else {
-                       if (alg == CRYPTO_MD5_KPDK || alg == CRYPTO_SHA1_KPDK)
-                               ip->ip_off &= htons(IP_DF);
-                       else
-                               ip->ip_off = 0;
-               }
+               if (alg == CRYPTO_MD5_KPDK || alg == CRYPTO_SHA1_KPDK)
+                       ip->ip_off &= htons(IP_DF);
+               else
+                       ip->ip_off = 0;
 
                ptr = mtod(m, unsigned char *);
 



Home | Main Index | Thread Index | Old Index