lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200118223433.GA159952@bistromath.localdomain>
Date:   Sat, 18 Jan 2020 23:34:33 +0100
From:   Sabrina Dubroca <sd@...asysnail.net>
To:     David Ahern <dsahern@...il.com>
Cc:     netdev@...r.kernel.org,
        Stephen Hemminger <stephen@...workplumber.org>,
        Herbert Xu <herbert@...dor.apana.org.au>
Subject: Re: [PATCH iproute2-next] ip: xfrm: add espintcp encapsulation

2020-01-18, 14:24:45 -0700, David Ahern wrote:
> On 1/16/20 3:39 AM, Sabrina Dubroca wrote:
> > diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
> > index 32f560933a47..e310860b9f1f 100644
> > --- a/ip/ipxfrm.c
> > +++ b/ip/ipxfrm.c
> > @@ -759,6 +759,9 @@ void xfrm_xfrma_print(struct rtattr *tb[], __u16 family,
> >  		case 2:
> >  			fprintf(fp, "espinudp ");
> >  			break;
> > +		case 7:
> > +			fprintf(fp, "espintcp ");
> > +			break;
> >  		default:
> >  			fprintf(fp, "%u ", e->encap_type);
> >  			break;
> > @@ -1211,6 +1214,8 @@ int xfrm_encap_type_parse(__u16 *type, int *argcp, char ***argvp)
> >  		*type = 1;
> >  	else if (strcmp(*argv, "espinudp") == 0)
> >  		*type = 2;
> > +	else if (strcmp(*argv, "espintcp") == 0)
> > +		*type = 7;
> >  	else
> >  		invarg("ENCAP-TYPE value is invalid", *argv);
> >  
> 
> are there enums / macros for the magic numbers?

Yes, in include/uapi/linux/udp.h:

/* UDP encapsulation types */
#define UDP_ENCAP_ESPINUDP_NON_IKE	1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
#define UDP_ENCAP_ESPINUDP	2 /* draft-ietf-ipsec-udp-encaps-06 */
#define UDP_ENCAP_L2TPINUDP	3 /* rfc2661 */
#define UDP_ENCAP_GTP0		4 /* GSM TS 09.60 */
#define UDP_ENCAP_GTP1U		5 /* 3GPP TS 29.060 */
#define UDP_ENCAP_RXRPC		6
#define TCP_ENCAP_ESPINTCP	7 /* Yikes, this is really xfrm encap types. */


Since the existing code wasn't using them (no idea why), I did the
same. I can change that if you prefer (and add udp.h to iproute's
include/uapi, since it's currently missing).

-- 
Sabrina

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ