Skip to contentSkip to conversation

'ip' command should allow creation of an IPsec SA with 'proto any' and specified sport and dport as selectors

DISCUSSION Jiri Klimes 2 participants 3 messages Apr 24, 2009 8 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

Hello,

please find a patch in the attachment.
I propose the patch to allow creation of an IPsec SA shareble by more protocols (TCP, UDP, ...)

Description:

When creating an IPsec SA that sets 'proto any' (IPPROTO_IP) and specifies 'sport' and 'dport' at the same time in selector, the following error is issued:
"sport" and "dport" are invalid with proto=ip

However using IPPROTO_IP with ports is completely legal and necessary when one wants to share the SA on both TCP and UDP.
One of the applications requiring sharing SAs is 3GPP IMS AKA authentication.

testcase:
ip x s add src 10.0.0.10 dst 10.0.0.20 proto esp spi 0x3113 enc cipher_null "" auth md5 0xbde359723576fdea08e56cbe876e24ad mode transport sel proto any sport 1234 dport 4321

Note: XFRM allows this programatically.

Could you please review the patch and apply it.

Cheers,
Jiri Klimes

PS: a bug report on this is filed in redhat's bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=497355

maintainer
#9 lore raw

From: "Jiri Klimes" <[email protected]>
Date: Fri, 24 Apr 2009 13:11:34 +0200

Quoted 1 line

please find a patch in the attachment.

There is no attachment.

#10 lore raw

______________________________________________________________

Quoted 6 lines

Od: [email protected]
Komu: [email protected]
CC: [email protected]
Datum: 24.04.2009 13:49
Předmět: Re: 'ip' command should allow creation of an IPsec SA with 'proto any' and specified sport and dport as selectors

Quoted 7 lines

From: "Jiri Klimes" <[email protected]>
Date: Fri, 24 Apr 2009 13:11:34 +0200

Quoted 1 line

please find a patch in the attachment.

There is no attachment.

oops, sorry.
Forgot the most important.

ip/ipxfrm.c +1 -0
@@ -1156,6 +1156,7 @@ static int xfrm_selector_upspec_parse(struct xfrm_selector *sel,
                case IPPROTO_UDP:
                case IPPROTO_SCTP:
                case IPPROTO_DCCP:
+               case IPPROTO_IP:  /* to allow shared SA for different protocols */
                        break;
                default:
                        fprintf(stderr, "\"sport\" and \"dport\" are invalid with proto=%s\n", strxf_proto(sel->proto));